SecretKeyWallet
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:30
A local signer that holds a secret key (and optional view-only key) in memory, using the WASM module for transaction hashing and Schnorr signing.
For production use, prefer WalletDaemonSigner so the secret key never lives
in JavaScript memory.
Prefer SecretKeyWallet.getViewSecret for view-secret access; SecretKeyWallet.getViewOnlySecret is retained for back-compat.
Implements
Section titled “Implements”Signer
Properties
Section titled “Properties”network
Section titled “network”
readonlynetwork:Network
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:35
Methods
Section titled “Methods”addStealthSignature()
Section titled “addStealthSignature()”addStealthSignature(
unsignedJson,publicNonce,sealPublicKey,ctx):Promise<TransactionSignature>
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:168
Produces a one-time spend-key signature for a stealth input (Signer.addStealthSignature).
Derives the one-time spend scalar (c + k) for the owned stealth UTXO via
stealthDhSecret(network, ownerSecret, publicNonce), then signs via the WASM
addTransactionSigner (same path as signTransaction).
The returned TransactionSignature carries the one-time spend public key (not the wallet’s owner public key) — it authorizes the specific stealth UTXO being spent.
Parameters
Section titled “Parameters”unsignedJson
Section titled “unsignedJson”string
publicNonce
Section titled “publicNonce”Uint8Array
sealPublicKey
Section titled “sealPublicKey”Uint8Array
crypto
Section titled “crypto”SignerStealthCrypto
Returns
Section titled “Returns”Promise<TransactionSignature>
Implementation of
Section titled “Implementation of”Signer.addStealthSignature
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:110
Returns
Section titled “Returns”Promise<string>
Throws
Section titled “Throws”when the view-only key has not been set on this wallet.
Implementation of
Section titled “Implementation of”Signer.getAddress
getPublicKey()
Section titled “getPublicKey()”getPublicKey():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:121
Returns the raw public key bytes for this signer.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Implementation of
Section titled “Implementation of”Signer.getPublicKey
getViewOnlySecret()
Section titled “getViewOnlySecret()”getViewOnlySecret():
Uint8Array<ArrayBufferLike> |null
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:133
Returns the view-only secret key, if one was set. Used for stealth/confidential output scanning.
Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | null
getViewSecret()
Section titled “getViewSecret()”getViewSecret():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:147
Returns the view-only secret for stealth scanning/spending (Signer.getViewSecret).
Intentionally duplicates getViewOnlySecret (the pre-existing synchronous public
accessor): this async method conforms to the Signer interface, while the original is
kept unchanged to avoid a breaking API change.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
Throws
Section titled “Throws”when no view-only secret is set on this wallet (e.g. a wallet built via fromSecretKey/fromKeypair without a view secret).
Implementation of
Section titled “Implementation of”Signer.getViewSecret
signTransaction()
Section titled “signTransaction()”signTransaction(
unsignedTx,sealPublicKey):Promise<TransactionSignature[]>
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:180
Signs the given unsigned transaction and returns the collected signatures.
sealPublicKey is mixed into the transaction hash
(hashUnsignedTransaction(JSON.stringify(tx), sealPublicKey)) so every signature in the
final envelope verifies against the SAME hash — the engine’s seal verification enforces
this. Implementations MUST hash with the supplied sealPublicKey, not their own.
Parameters
Section titled “Parameters”unsignedTx
Section titled “unsignedTx”UnsignedTransactionV1
sealPublicKey
Section titled “sealPublicKey”Uint8Array
Returns
Section titled “Returns”Promise<TransactionSignature[]>
Implementation of
Section titled “Implementation of”Signer.signTransaction
fromKeypair()
Section titled “fromKeypair()”
staticfromKeypair(ownerSecretKey,ownerPublicKey,network,viewOnlySecret?):SecretKeyWallet
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:91
Creates a wallet directly from a secret key and its corresponding public key. Use this overload if you already have both keys (e.g. from key storage).
Parameters
Section titled “Parameters”ownerSecretKey
Section titled “ownerSecretKey”Uint8Array
ownerPublicKey
Section titled “ownerPublicKey”Uint8Array
network
Section titled “network”Network
viewOnlySecret?
Section titled “viewOnlySecret?”Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”SecretKeyWallet
Throws
Section titled “Throws”if ownerSecretKey, ownerPublicKey, or
viewOnlySecret (when supplied) is not exactly 32 bytes.
fromSecretKey()
Section titled “fromSecretKey()”
staticfromSecretKey(ownerSecretKey,network,viewOnlySecret?):SecretKeyWallet
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:69
Creates a wallet from an existing hex-encoded account secret key.
The public key is derived via wasm.derivePublicKey.
Parameters
Section titled “Parameters”ownerSecretKey
Section titled “ownerSecretKey”Uint8Array
network
Section titled “network”Network
viewOnlySecret?
Section titled “viewOnlySecret?”Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”SecretKeyWallet
Throws
Section titled “Throws”if ownerSecretKey (or viewOnlySecret, when
supplied) is not exactly 32 bytes.
randomWithViewKey()
Section titled “randomWithViewKey()”
staticrandomWithViewKey(network):SecretKeyWallet
Defined in: ootle-secret-key-wallet/src/secret-key-wallet.ts:56
Generates a fresh random account keypair and a separate random view-only key.
The view-only key is used for stealth/confidential output scanning.
Mirrors OotleSecretKey { account_secret, view_only_secret } from ootle-rs.
Parameters
Section titled “Parameters”network
Section titled “network”Network
Returns
Section titled “Returns”SecretKeyWallet