Skip to content

Direct-Spend Sequence (Bounded TRQ1)

This page describes the current direct-spend execution sequence using the public runtime/wallet façade entrypoints.

Sequence

  1. Wallet selects or is provided the authoritative continuation outpoint (txid:vout).
  2. Wallet builds the proof input using prepareDirectSpendProofInput(...).
  3. Runtime proves with proveDirectSpend(...).
  4. Runtime verifies with verifyDirectSpend(...).
  5. Wallet builds plan metadata with buildDirectSpendPlan(...).
  6. Wallet assembles host checks + tx flow with assembleDirectSpendTx(...).
  7. Wallet broadcasts through its BCH transport implementation.
  8. Receiver wallet runs recoverDirectSpendOutputs(...) against discovered candidates.

Minimal façade flow

const proofInput = prepareDirectSpendProofInput(...);
const proved = await proveDirectSpend(proofInput);
await verifyDirectSpend(proved);
const plan = buildDirectSpendPlan(...);
const assembled = await assembleDirectSpendTx(plan);
const recovery = recoverDirectSpendOutputs(...);

Boundary notes

  • standalone/prover-runtime is the reference protocol runtime boundary.
  • packages/direct-spend-wallet is the reference wallet integration boundary.
  • External adopters should use package-root façade exports only.
  • Deep src/* imports are implementation detail and may change without notice.
  • This sequence does not change the bounded TRQ1 proof statement; it clarifies the public integration surface.
  • Host checks remain fail-closed before broadcast on mismatch.