Skip to content

Implement verification states, time locks and required consensus rules - #73

Open
aagbotemi wants to merge 15 commits into
rust-bitcoin:masterfrom
aagbotemi:feat/verification-states
Open

Implement verification states, time locks and required consensus rules#73
aagbotemi wants to merge 15 commits into
rust-bitcoin:masterfrom
aagbotemi:feat/verification-states

Conversation

@aagbotemi

@aagbotemi aagbotemi commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Implement the spec's three-state verifier output, time lock support for full signatures, explicit enforcement of the required consensus rules, and spec-compliant prevout resolution for proof of funds.

Rebased on #71

Changes

  • Add Verification enum (Valid { time, age } / Inconclusive).
  • Add internal InputVerification for per-input outcomes.
  • Add LockParams to set nLockTime and nSequence on to_sign.
  • All verify_* functions now return Result<Verification>, with the invalid state reported as Err.

Notes for reviewers

  • Uninterpretable scripts (taproot script-path spends, non-multisig witness scripts, unknown script types) report Inconclusive rather than erroring.
  • The upgradeable version rule (nVersion must be 0 or 2) is checked after input verification, so a required-rule failure (e.g. bad signature) still reports invalid even on an unsupported version.
  • LockParams version is derived — 2 when any lock is set, else 0, so an inconsistent version can't be constructed. Threaded through sign_full, sign_full_encoded, sign_pof, sign_pof_encoded and create_to_sign. The simple variant keeps all-zero locks per the spec.
  • Resolve proof-of-funds prevouts from PSBT UTXO fields instead of a caller-supplied parameter. Proof-of-funds prevout resolution includes the spec's same-txid non-witness UTXO fallback.

Closes #72

@aagbotemi
aagbotemi force-pushed the feat/verification-states branch from b3d5c8c to a186d35 Compare July 27, 2026 09:03
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.

Implement verifier states, time locks, and required consensus rules

1 participant