It looks like eth evm transactions need “v” in the transaction that specifies which point was used. I see how to get r and s, but what would v be? Is it always the same? Is it per curve?
sign_with_ecdsa
: This method returns a new ECDSA signature of the givenmessage_hash
that can be separately verified against a derived ECDSA public key. This public key can be obtained by callingecdsa_public_key
with the caller’scanister_id
, and the samederivation_path
andkey_id
used here.
The signatures are encoded as the concatenation of the SEC1 encodings of the two valuesr
ands
. For curvesecp256k1
, this corresponds to 32-byte big-endian encoding.
Edit: Looks like you get it from r:
Once we have valid values for r and s , the last piece of the signature is v . This value allows you to calculate the public key from a transaction signature. There are a couple of different ways to derive this, but for our purposes, we’ll just use 37 if r is even and 38 if r is odd, as this follows EIP-155.