Sigma Library
A digital signature scheme for signing Bitcoin transaction data.
A Go version of this library is available at github.com/bitcoinschema/go-sigma
Library Usage
To use the Sigma Protocol library, follow the instructions below:
Install the library and peer dependency using npm / yarn / bun:
You can use the
verify
method to check a signature:
Use the
sign
function to sign your data:
Use the
verify
method to verify the signature:
You can select a transaction output, and sigma instance to target. If you do not specify a target, the first output and first sigma instance will be assumed.
Here we target output index 1:
Here we target output index 1, sigma instance 2:
Once an instance is targeted, you can use verify like normal:
If you sign a tx and the sign it a again the signature will be replaced. However, you can add additional signatures by incrementing the sigma instance number before signing.
Remote Signatures
This library supports using a remove key server such as starfish or tokenpass. use the sigmaInstance.remoteSign(keyHost)
method to sign the message buffer using a remove key service instead of passing in a private key. This will take a second parameter, authTokenHeader
object which will be forwarded as a header to the key server. This is useful if you need a signing server in the cloud.
Building the Library:
To build the Sigma Protocol library yourself, follow these steps:
Clone the repository:
Navigate to the project directory and install dependencies:
Build the library:
The compiled JavaScript files will be output to the ./dist
directory.
Last updated