Firaenix / bsv-wasm

BSV stdlib written in Rust and runs in WASM environments
MIT License
70 stars 19 forks source link

Make signing methods clearer #20

Closed Firaenix closed 3 years ago

Firaenix commented 3 years ago

There are different ways to sign a message or message digest dependent on:

Maybe a good way to approach this is having simple sign methods on different structs (like Transaction)

Firaenix commented 3 years ago

Idea:

  1. Transaction.sign() - Sighash signing
  2. PrivateKey.signBitcoinMessage() - BSM Signing
  3. PrivateKey.sign() / PrivateKey.signTraditional() - Non Bitcoin/Standard ECDSA message signing
Firaenix commented 3 years ago

Or if you're signing something to be verified with an Address (BSM), Address.signMessage()

utxo-detective commented 3 years ago

image

utxo-detective commented 3 years ago

Or if you're signing something to be verified with an Address (BSM), Address.signMessage()

@Firaenix how would this work? You'd need to still have a private key? Wouldnt it be the same as PrivateKey.signBitcoinMessage()? When you need to verify it you can just get the address from the private key

Firaenix commented 3 years ago

Released in 1.1.0