In-memory single key implementation for Bitcoin transaction signing.
// Create from hex stringconst key = SingleKey.fromHex('your_private_key_hex');// Create from raw bytesconst key = SingleKey.fromPrivateKey(privateKeyBytes);// Create random keyconst randomKey = SingleKey.fromRandomBytes();// Sign a transactionconst signedTx = await key.sign(transaction); Copy
// Create from hex stringconst key = SingleKey.fromHex('your_private_key_hex');// Create from raw bytesconst key = SingleKey.fromPrivateKey(privateKeyBytes);// Create random keyconst randomKey = SingleKey.fromRandomBytes();// Sign a transactionconst signedTx = await key.sign(transaction);
Optional
Export the private key as a hex string.
The private key as a hex string
Static
In-memory single key implementation for Bitcoin transaction signing.
Example