/** * Canonical `vaultContext` byte encoding per * `derive-vault-secrets.md` §2.3. * * ``` * vaultContext := * I2OSP(32, 4) || depositorBtcPubkey // 32B x-only * || I2OSP(32, 4) || fundingOutpointsCommitment // 32B SHA-256 * ``` * * `fundingOutpointsCommitment` is SHA-256 over the canonically-sorted * funding outpoints of the Pre-PegIn transaction, serialized as * `txid (32B display/RPC order) || vout (4B u32 big-endian)` per * outpoint. Sorting by 36-byte lex order makes the commitment * invariant under tx-level input reordering, so same-inputs RBF and * reorg rebroadcasts yield the same context. * * @module vault-secrets/context */ export interface FundingOutpoint { /** * Bitcoin txid in **display / RPC order** (byte-reversed from the * internal little-endian wire form used when hashing a raw tx). */ txid: Uint8Array; /** Output index within the referenced transaction (u32). */ vout: number; } export interface VaultContextInput { /** Depositor's x-only BTC public key (32 bytes). */ depositorBtcPubkey: Uint8Array; /** Funding outpoints of the Pre-PegIn transaction. MUST be non-empty. */ fundingOutpoints: readonly FundingOutpoint[]; } /** * Compute SHA-256 over canonically-sorted funding outpoints. * * Outpoints are serialized as 36-byte `txid || vout_BE`, sorted * ascending lexicographically, concatenated, then hashed. * * @stability frozen — on-chain-binding. Any change to layout, sort * order, or serialization is a hard fork; existing deposits would no * longer match their committed `depositorWotsPkHash`. * * @throws If `outpoints` is empty or contains duplicates. */ export declare function buildFundingOutpointsCommitment(outpoints: readonly FundingOutpoint[]): Uint8Array; /** * Build the canonical `vaultContext` byte string fed into the wallet's * `deriveContextHash` (or a locally-implemented equivalent on the * app side). * * Output length is always 72 bytes. * * @stability frozen — on-chain-binding. The 72-byte layout is the * input to `deriveContextHash`; any change rotates the vault root and * therefore every WOTS key, hashlock secret, and auth anchor derived * from it. Existing deposits cannot be recovered after a layout change. */ export declare function buildVaultContext(input: VaultContextInput): Uint8Array; //# sourceMappingURL=context.d.ts.map