Skip to content

StealthTransferStatement

Defined in: ootle/src/stealth/statements.ts:233

The top-level stealth-transfer envelope assembled in TS.

Combines the WASM-produced inputs/outputs statement JSONs with the balance-proof (public_nonce, signature). balanceProof is undefined until the authorizer fills it in.

Two distinct serialisations, intentionally separate:

  1. toJSON / fromJSON — a purely structural, symmetric, lossless round-trip used by tests and any TS-only persistence. It does NOT re-parse WASM statement strings into JS numbers; the outputs side is carried as its raw wire string.
  2. toCompactJson — the signed wire form. It embeds the WASM-produced statement strings byte-exact by string concatenation of raw canonical fragments — it never JSON.parses a WASM string (raw u64 µTari amounts routinely exceed 2^53, so parse→number→re-stringify silently corrupts them and breaks the signature). This is the form fed to validateStealthTransfer and any hashing/signing path.

The byte-exactness of the WASM fragments in toCompactJson is non-negotiable: the engine validates against the exact bytes signed.

new StealthTransferStatement(inputsStatement, outputsStatement, balanceProof?): StealthTransferStatement

Defined in: ootle/src/stealth/statements.ts:238

StealthInputsStatement

StealthOutputsStatement

BalanceProofSignature

StealthTransferStatement

optional balanceProof?: BalanceProofSignature

Defined in: ootle/src/stealth/statements.ts:236


readonly inputsStatement: StealthInputsStatement

Defined in: ootle/src/stealth/statements.ts:234


readonly outputsStatement: StealthOutputsStatement

Defined in: ootle/src/stealth/statements.ts:235

toCompactJson(): string

Defined in: ootle/src/stealth/statements.ts:280

The signed wire form: a single canonical compact JSON string in which the WASM-produced statement fragments are embedded byte-exact.

Built by concatenating raw canonical fragments — it never JSON.parses a WASM statement string, so raw u64 µTari amounts (which can exceed 2^53) survive uncorrupted. The inputs fragment prefers the cached WASM statementJson (the canonical signed bytes); it falls back to JSON.stringify of the structural inputs view only when no WASM string is present (the revealed-only / test case). The outputs fragment is always the raw WASM statementJson string. The balance-proof object is small, all-hex (no large integers), so it routes through JSON.stringify safely.

string

if either statement fragment is not a JSON object.


toJSON(): StealthTransferStatementJson

Defined in: ootle/src/stealth/statements.ts:254

Structural view of the envelope (debug / lossless round-trip — NOT the signed wire form; see toCompactJson). The inputs side is the inputs statement’s structural toJSON(); the outputs side is its raw wire string, carried verbatim (never parsed). balance_proof is omitted when undefined.

StealthTransferStatementJson


static fromJSON(json): StealthTransferStatement

Defined in: ootle/src/stealth/statements.ts:298

Reconstruct from the structural toJSON shape. Symmetric and lossless.

StealthTransferStatementJson

StealthTransferStatement