Skip to content

feat(tx-manifest): validate semantics and finalized intent - #15

Open
lukachi wants to merge 1 commit into
feature/tx-manifest-assetsfrom
feature/tx-manifest-validation
Open

feat(tx-manifest): validate semantics and finalized intent#15
lukachi wants to merge 1 commit into
feature/tx-manifest-assetsfrom
feature/tx-manifest-validation

Conversation

@lukachi

@lukachi lukachi commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Stack position

PR 6 of 9 in the txManifest release train.

Base: feature/tx-manifest-assets (PR #14)

This slice makes the reviewed plan reject what it cannot establish and verifies that the finalized Elements transaction is the transaction the wallet agreed to build. Later PRs add the inspector, confirmation UI, and application activation.

What changes

  • adds stable rejection tokens for unsupported constructs, malformed declarations, missing request data, chain failures, funding failures, and builder disagreement
  • evaluates signed 64-bit manifest arithmetic with explicit overflow, division-by-zero, remainder-by-zero, and negative-exponent refusal
  • fills parameters in supplied, computed, then default order
  • runs input on_resolved hooks before action on_pre_broadcast hooks and resolves static witnesses
  • validates arithmetic rules, issuance amounts, input positions, sequence declarations, and per-input funding pins
  • accounts for duplicate change declarations and multi-asset issuance/funding constraints
  • parses complete serialized Elements transactions, including issuance and witness records, with canonical compact-size encoding and no trailing bytes
  • checks exact input multiplicity and the complete output shape: planned outputs, optional change, then the explicit policy-asset fee
  • integrates those guards after the injected finalizer and returns built-something-else with no transaction on mismatch
  • vendors both published manifest generations as a regression corpus; 8,886 of the added lines are fixture data copied byte-for-byte from the completed implementation

Review guide

  1. packages/tx-manifest/src/document/refuse.ts and document/registry.ts define the refusal contract and unsupported-construct inventory.
  2. packages/tx-manifest/src/evaluation contains expression, hook, parameter, validation, position, sequence, and witness semantics.
  3. packages/tx-manifest/src/review/index.ts composes those semantics into one exact review plan.
  4. packages/tx-manifest/src/chain/rawTransaction.ts and chain/guards.ts independently read finalized bytes and compare them with that plan.
  5. apps/extension/src/core/chains/liquid/adapters/smplx/assembleReviewedTransaction.ts applies the guard after finalization.

Verification

Clean detached checkout at commit 30d0e44 with smplx 8f0215c (SDK 0.0.10) and LWK 693c4fb:

  • package TypeScript gate passed
  • explicit smplx adapter TypeScript gate passed
  • repository-wide oxlint passed
  • repository-wide oxfmt check passed
  • 534 package and adapter tests passed, 0 failed

Deliberately excluded

  • manifest inspector and developer tooling (PR 7)
  • confirmation rendering and clear-signing UI (PR 8)
  • application activation, credential ownership, concrete signing, broadcasting, dependency convergence, and the restored full root gate (PR 9)

The bundle remains open until the full train is delivered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant