Skip to main content

Sign a Message

After storing a private key in Nillion, anyone with permissions can use SecretSigner to sign messages or transactions with it. During signing:

  • The message to be signed and key's store id are provided
  • The message is hashed before being sent to the network
  • SecretSigner creates an ECDSA signature using the stored key shares
  • The signature is returned for use with other applications

When signing a message, only the message hash is sent to the network - the original message stays private.

Usage

Python Client

Install Nillion Python Client

pip install nillion-client

Python Client: Sign a Message

nilvm/secretsigner-python/signWithStoredPrivateKey.py
loading...

Signature Verification

Anyone can verify the signature using the same message hash and the public key that corresponds to the private key stored in Nillion. During verification:

  • Use the signature (r, s) values returned from SecretSigner tecdsa_signature output
  • Hash the message using SHA-256
  • Verify using any standard ECDSA verification library

Since SecretSigner returns standard ECDSA signatures, verification works just like it would for any other ECDSA signature.