I am trying to understand what happens under the hood when we call window.solana.signMessage.
Asked
Active
Viewed 1,142 times
1 Answers
2
Solana uses the ed25519 curve for its cyrptography, so a transaction signature is:
A 64-byte ed25519 signature of R (32-bytes) and S (32-bytes). With the requirement that R is a packed Edwards point not of small order and S is a scalar in the range of 0 <= S < L. This requirement ensures no signature malleability.
The actual code called is tweetnacl
's sign.detached
function.
More information at the official docs: https://docs.solana.com/terminology#signature
The Solana transaction sign code: https://github.com/solana-labs/solana/blob/2a5764ef79cff391da080cc19617f171109c4158/web3.js/src/transaction.ts#L522
The underlying tweetnacl code: https://github.com/dchest/tweetnacl-js/blob/971d653d301cff2dd694e95a099cb42d9201e922/nacl.js#L1076

Jon C
- 7,019
- 10
- 17