Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 52 additions & 82 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ default = []
wasm = ["bsv-rs/wasm"]

[dependencies]
bsv-rs = { version = "=0.9.0-beta.10", default-features = false, features = ["transaction"] }
bsv-rs = { version = "=0.9.0-beta.12", default-features = false, features = ["transaction"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# bsv-tracker

**0.9.0-beta.11**, a transaction evidence state machine: a prerelease of the
`beta` line, on **bsv-rs =0.9.0-beta.10**. The stable line is `main`, whose
`beta` line, on **bsv-rs =0.9.0-beta.12**. The stable line is `main`, whose
release 0.8.0 is on bsv-rs 0.8.0. crates.io carries both versions; the
repository's Releases page has a Release for each tag.

Expand Down Expand Up @@ -38,7 +38,7 @@ a restored `Word::Mined` comes back suspect with `Reask::Recheck` due, and a

A transaction of exactly 64 bytes is never taken as proven by a merkle path
(BRC-237's condition for an anchor; bsv-rs enforces it in its own verifier,
its public advisory GHSA-jjhc-7hvh-c3hm). The crate holds a txid and a path,
its public advisories GHSA-jjhc-7hvh-c3hm and GHSA-3h6g-mj4h-rw57). The crate holds a txid and a path,
so the host tells it the length, and these are the host's duties:

- Build a proof from the transaction's serialized bytes, `Proof::new(&raw_tx,
Expand Down
4 changes: 2 additions & 2 deletions docs/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

### The two machines

The Lean keeps two functions, `step` and `stepRecheck`, equal on every input but a chain event or an executed recheck that finds a `conflicted` word (`stepRecheck_eq_step`, line 2705). The crate is one `State::step` that reads `Params::recheck_conflicted`, so a host chooses once, in the parameters every entry point already carries (`State::step`, `Tracker::apply`, `Tracker::on_chain`).
The Lean keeps two functions, `step` and `stepRecheck`, equal on every input but a chain event or an executed recheck that finds a `conflicted` word (`stepRecheck_eq_step`, line 2705). The crate is one `State::step` that reads `Params::recheck_conflicted`, so a host chooses once, in its `Params`: `State::step` takes them as its argument, and `Tracker::apply` and `Tracker::on_chain` take none, since the tracker holds the `Params` it was given by `Tracker::new`, which is where a host of the tracker picks the mode.

- **The latch**, the default (`false`, the Lean's `step`). A `conflicted` word stays `conflicted` under every chain event and recheck (`step_conflicted_latched`, line 2671). It leaves only by the transaction's own checked proof, which writes `mined` from any word (`returned_then_mined`), or by a node's `rejected`.
- **The door** (`true`, the Lean's `stepRecheck`). A `conflicted` word meeting `Evidence::Chain` or `Evidence::Recheck` goes through the recheck of the conflict; every other input is the latch's step. The recheck reads the host's header at each standing competitor's height that carries a proof, one read each, and nothing more: no depth, no doubt and no clock. What starts it is a row of the feed or the host's executed recheck, never a timer.
Expand All @@ -106,7 +106,7 @@ Both machines answer the length rule, the refusal of the tracked txid as its own

## The length of a transaction

A transaction of exactly 64 bytes is never taken as proven by a merkle path (BRC-237's condition for an anchor; bsv-rs enforces it in its own verifier, its public advisory GHSA-jjhc-7hvh-c3hm). This crate holds a txid and a path and compares the root with the host's header itself, so no library it pins applies the rule here: the crate is told the transaction's length, measured from its bytes or stated by its host, and every door that takes a proof reads it.
A transaction of exactly 64 bytes is never taken as proven by a merkle path (BRC-237's condition for an anchor; bsv-rs enforces it in its own verifier, its public advisories GHSA-jjhc-7hvh-c3hm and GHSA-3h6g-mj4h-rw57). This crate holds a txid and a path and compares the root with the host's header itself, so no library it pins applies the rule here: the crate is told the transaction's length, measured from its bytes or stated by its host, and every door that takes a proof reads it.

[SRC] The rule's words are bsv-stack-lean's `docs/DECISIONS-2026-10-19.md` 32.13 at `9a727a64653b602377b6c3acad543e6997544bfb`. `lean/Tracker.lean` at that commit holds no length (no `txLen` in any Lean file): every item below but `State::new` is ahead of the Lean, marked `[AHEAD]`. The Lean names in the table are proposals for its mirror, apart from `State.txLen`, whose name is ruled.

Expand Down
2 changes: 1 addition & 1 deletion docs/VERIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ Not mirrored here: `Host.lean`'s hosts over a journal (`host_is_run`, `two_hosts

## The length rule as properties and goldens (GHSA-jjhc-7hvh-c3hm, BRC-237, 2026-11-28)

A transaction of exactly 64 bytes is never taken as proven by a merkle path (BRC-237's condition for an anchor; bsv-rs enforces it in its own verifier, its public advisory GHSA-jjhc-7hvh-c3hm). The crate measures the transaction: `State::tx_len`, the two constructors of `Proof` and the doors that read a length. This section is the rule's randomized statements and its compact goldens; the tables and the witness are `tests/measure.rs` and `tests/proof_length.rs`.
A transaction of exactly 64 bytes is never taken as proven by a merkle path (BRC-237's condition for an anchor; bsv-rs enforces it in its own verifier, its public advisories GHSA-jjhc-7hvh-c3hm and GHSA-3h6g-mj4h-rw57). The crate measures the transaction: `State::tx_len`, the two constructors of `Proof` and the doors that read a length. This section is the rule's randomized statements and its compact goldens; the tables and the witness are `tests/measure.rs` and `tests/proof_length.rs`.

[SRC] The stack: bsv-stack-lean at `901e9dfa` (`901e9dfaac42b5dafdf5d5f2c552933dc1c28cd4`), `docs/DECISIONS-2026-10-19.md` 32.13 for the rule's words. `lean/Tracker.lean` there holds no measured length (no `txLen` in any Lean file): every name in the table below is ahead of the Lean and a proposal, apart from `txLen`, whose name is ruled.

Expand Down
10 changes: 5 additions & 5 deletions src/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl std::error::Error for HeaderError {}
/// The one length, in bytes, at which a merkle path proves nothing: a
/// transaction of exactly 64 bytes is never taken as proven by a merkle path
/// (BRC-237's condition for an anchor; bsv-rs enforces it in its own
/// verifier, its public advisory GHSA-jjhc-7hvh-c3hm).
/// verifier, its public advisories GHSA-jjhc-7hvh-c3hm, GHSA-3h6g-mj4h-rw57).
///
/// A host and a test read this constant, never the literal: a state whose
/// [`State::tx_len`](crate::State::tx_len) is `Some(AMBIGUOUS_TX_LEN)` takes
Expand Down Expand Up @@ -146,10 +146,10 @@ pub(crate) enum Len {
///
/// A transaction of exactly 64 bytes is never taken as proven by a merkle
/// path (BRC-237's condition for an anchor; bsv-rs enforces it in its own
/// verifier, its public advisory GHSA-jjhc-7hvh-c3hm). The crate holds the
/// path and the txid, so it is told the length at the constructor: from the
/// transaction's bytes ([`Proof::new`]), or as the host's word
/// ([`Proof::with_stated_len`]). Neither yields a proof at
/// verifier, its public advisories GHSA-jjhc-7hvh-c3hm, GHSA-3h6g-mj4h-rw57).
/// The crate holds the path and the txid, so it is told the length at the
/// constructor: from the transaction's bytes ([`Proof::new`]), or as the
/// host's word ([`Proof::with_stated_len`]). Neither yields a proof at
/// [`AMBIGUOUS_TX_LEN`].
///
/// Two proofs are equal when their txid, height and path are: the length a
Expand Down
2 changes: 1 addition & 1 deletion src/hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fmt;

/// A broadcaster's claim reduced to the Lean hint vocabulary.
///
/// `#[non_exhaustive]` (the room made before 0.9.0, bsv-stack-lean
/// `#[non_exhaustive]` (the room made at 0.9.0-beta.9, bsv-stack-lean
/// `docs/DECISIONS-2026-10-19.md` 28.8.1 (c)): a later minor may add a kind,
/// so a host's match outside this crate carries a wildcard arm. A hint status
/// is stored by its serde form and read back by it, never mapped by hand, and
Expand Down
4 changes: 2 additions & 2 deletions tests/compact_golden.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,8 @@ fn mined_measured_by_its_proof() {
assert_eq!(restored.evidence(), s.evidence());
}

/// The ten states of record with the version 1 bytes each wrote up to
/// 0.9.0-beta.11, verbatim. They are the reader's record and never move: a
/// The ten states of record with the version 1 bytes each wrote up to and
/// including 0.9.0-beta.10, verbatim. They are the reader's record and never move: a
/// version 1 row a host stored still restores.
type Record = (&'static str, fn() -> State, &'static str);
const VERSION_1: [Record; 10] = [
Expand Down
Loading