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:
- 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.
- 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 tovalidateStealthTransferand any hashing/signing path.
The byte-exactness of the WASM fragments in toCompactJson is non-negotiable: the engine validates against the exact bytes signed.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new StealthTransferStatement(
inputsStatement,outputsStatement,balanceProof?):StealthTransferStatement
Defined in: ootle/src/stealth/statements.ts:238
Parameters
Section titled “Parameters”inputsStatement
Section titled “inputsStatement”outputsStatement
Section titled “outputsStatement”balanceProof?
Section titled “balanceProof?”Returns
Section titled “Returns”StealthTransferStatement
Properties
Section titled “Properties”balanceProof?
Section titled “balanceProof?”
optionalbalanceProof?:BalanceProofSignature
Defined in: ootle/src/stealth/statements.ts:236
inputsStatement
Section titled “inputsStatement”
readonlyinputsStatement:StealthInputsStatement
Defined in: ootle/src/stealth/statements.ts:234
outputsStatement
Section titled “outputsStatement”
readonlyoutputsStatement:StealthOutputsStatement
Defined in: ootle/src/stealth/statements.ts:235
Methods
Section titled “Methods”toCompactJson()
Section titled “toCompactJson()”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.
Returns
Section titled “Returns”string
Throws
Section titled “Throws”if either statement fragment is not a JSON object.
toJSON()
Section titled “toJSON()”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.
Returns
Section titled “Returns”StealthTransferStatementJson
fromJSON()
Section titled “fromJSON()”
staticfromJSON(json):StealthTransferStatement
Defined in: ootle/src/stealth/statements.ts:298
Reconstruct from the structural toJSON shape. Symmetric and lossless.
Parameters
Section titled “Parameters”StealthTransferStatementJson
Returns
Section titled “Returns”StealthTransferStatement