Skip to content

v0.2.0

Choose a tag to compare

@tee8z tee8z released this 06 Oct 11:31
· 4 commits to main since this release
v0.2.0
8896d89

Breaking changes

  • ContractParameters has two new public fields, anchor and outcome_bound_splits. Struct literals need anchor: None and outcome_bound_splits: false to keep 0.1.0 behaviour.
  • New Error variants: InvalidAnchorValue, MissingAnchor and UnboundSharedWinners.
  • validate now also rejects anchors below 240 sats, and, when outcome_bound_splits is false, attestation outcomes that pay the same winners different weights (UnboundSharedWinners). Set outcome_bound_splits: true for contracts with more than one paid place.

Features

  • Pay-to-anchor outputs (#14). With anchor: Some(AnchorParams { value }), every outcome, expiry and split transaction gets a P2A output (OP_1 <0x4e73>) as its last output, so anyone with spare coins can CPFP a stuck transaction during recovery. Transactions stay version 2 and keep paying fee_rate. Recovery helpers: anchor::find_anchor, SignedContract::presigned_tx_fee, SignedContract::cpfp_child_template and anchor::cpfp_child_template.
  • Outcome-bound splits (#15, #16). With outcome_bound_splits: true, each winner's split leaf starts with <outcome> OP_DROP, so every outcome has its own outcome output, outcome txid and split sighashes. Cooperative spending paths are unchanged.

Compatibility

  • Both fields default to off and are left out of serialization when off. Serialized 0.1.0 ContractParameters and SignedContract values deserialize, re-serialize to the same bytes, and rebuild byte-identical transactions and sighashes, so stored signatures keep verifying. tests/compat.rs checks this against the published 0.1.0 crate and a pinned digest.

Documentation

  • Corrected the fee notes: a split transaction's input carries a BIP-68 relative locktime of delta blocks, so it confirms delta blocks after its outcome transaction at the earliest.

This tag is GPG-signed by the maintainer.