Skip to Content

Signature verification

Focus: one signature-checking entry that verifies a signed byte message from the transaction sender.

Open in Playground 

crypto_tools.slx
entry verify_from_sender(message: bytes, signature: Signature) -> bool { let sender: Address = Transaction::current().unwrap().source() return signature.verify(message, sender.to_point()) }

How it works

  • message: bytes is the exact byte payload the wallet signed.
  • signature: Signature is verified inside the contract.
  • Transaction::current().unwrap().source() gets the transaction sender address.
  • sender.to_point() converts the address into the public key point expected by signature.verify.
  • The entry returns true only when the signature matches the sender and message.

Use wallet RPC sign_data to produce signatures for verify_from_sender.

Last updated on