Skip to content

Commit 694eea5

Browse files
committed
Record the TxRefHash correction and the M1-1 migration
The m1-2 review established that EB references must hash the complete transaction bytes (TxRefHash), not the body-identity TxId, which cannot pin witnesses; update the type sketches and the M1-3 issue accordingly, and correct the M1-2 issue's superseded AbstractFunctions threading bullet to the GovStructure design. Regions refreshed from the fork, recording issue #2 closed after its migration to IntersectMBO#1296 (delivered by IntersectMBO#1297). AI-assisted development: Claude Fable 5 (Anthropic)
1 parent c36624f commit 694eea5

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

docs/GITHUB_PROJECT_6WEEK.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -279,25 +279,28 @@ record LeiosAbstract : Type₁ where
279279
VotingKey EBHash : Type -- key: 96-byte BLS vkey on the wire
280280
VotingSig AggSig : Type
281281
KeyProof : Type -- proof of possession
282+
TxRefHash : Type -- hash of the COMPLETE tx bytes (CIP App. B)
282283
isSignedVote : VotingKey → Slot × EBHash → VotingSig → Type
283284
isSignedAgg : List VotingKey → Slot × EBHash → AggSig → Type
284285
validKeyProof : VotingKey → KeyProof → Type
285-
hashEBRefs : List (TxId × ℕ) → EBHash
286+
hashEBRefs : List (TxRefHash × ℕ) → EBHash
286287
-- plus DecEq instances and decidability of the three predicates
287288
```
288289

289290
The message type is literally `Slot × EBHash` (the CIP signs
290291
`concat(slot_no, endorser_block_hash)`); signing the pair directly
291292
avoids serialization plumbing. `hashEBRefs` fixes the EB identifier as
292293
the hash of the reference structure itself, checkable before any
293-
transaction data is fetched; the exact wiring (a plain function versus
294-
a `Hashable` instance) is an M1-2 choice.
294+
transaction data is fetched. References hash the complete transaction
295+
bytes, not the body-identity `TxId`: a `(TxId, size)` pair could not pin
296+
witnesses (settled in the m1-2 review; the as-built module matches this
297+
sketch).
295298

296299
```agda
297300
-- Leios/Types.lagda.md
298301
record EndorserBlock : Type where
299302
field
300-
ebTxRefs : List (TxId × ℕ) -- ordered references: id and declared size
303+
ebTxRefs : List (TxRefHash × ℕ) -- ordered references: hash and declared size
301304
-- CDDL: omap⟨hash32, uint16⟩; duplicate-freedom is a validity
302305
-- condition (alternative: carry a uniqueness proof field)
303306
@@ -402,7 +405,7 @@ written back as a `(#N)` suffix.
402405

403406
<!-- BEGIN GENERATED: milestone-1 -->
404407

405-
### Issue M1-1: Design note: the Leios Ledger Formalization plan decisions (#2)
408+
### Issue M1-1: Design note: the Leios Ledger Formalization plan decisions (#2, closed)
406409

407410
**Labels:** `documentation`, `milestone-1-foundations`, `Leios`, `discussion`
408411

@@ -441,10 +444,10 @@ Amendments (2026-08-19 field review, from the Musashi trace-verifier work; shipp
441444
## Description
442445

443446
New module `Ledger.Dijkstra.Specification.Leios.Abstract` with the `LeiosAbstract` record sketched in the plan's "Predicted new Agda types" section: abstract types for voting keys, signatures, aggregate
444-
signatures, proofs of possession, and EB hashes; verification predicates over the message `Slot × EBHash`; the EB-reference hash function; decidability instances.
447+
signatures, proofs of possession, EB hashes, and transaction-reference hashes (`TxRefHash`: the hash of the complete transaction bytes, per CIP-164 Appendix B); verification predicates over the message `Slot × EBHash`; the EB-reference hash function; decidability instances.
445448

446449
- [ ] Define the record; keep it scheme-agnostic (CIP-164 Appendix A); no concrete curve arithmetic, `--safe` throughout.
447-
- [ ] Thread it as a new field of `AbstractFunctions` in `Ledger.Dijkstra.Specification.Abstract`, so downstream module signatures do not change.
450+
- [ ] Thread it as a new `leiosAbstract` field of `GovStructure` (`Gov/Base.lagda.md`), supplied through `TransactionStructure`, so downstream module signatures do not change. (Revised during review: `Certs` sees only `GovStructure` and sits upstream of `AbstractFunctions`, so an `AbstractFunctions` field cannot reach the registration rule's proof-of-possession premise.)
448451
- [ ] Module prose: one paragraph on the BLS12-381 instantiation and the Peras-sharing intent, with the core-migration noted as follow-up.
449452

450453
Estimated effort: 2 days.
@@ -456,9 +459,10 @@ Full-roadmap counterpart: M1-1 (scoped down: Dijkstra-local, no `Ledger.Core` ch
456459

457460
**Labels:** `milestone-1-foundations`, `Leios`, `era: dijkstra`
458461

459-
New module `Ledger.Dijkstra.Specification.Leios.Types` with `EndorserBlock` (ordered transaction references: id and declared size), `Announcement`, `Vote`, and `Certificate`, per the sketches in the plan.
462+
New module `Ledger.Dijkstra.Specification.Leios.Types` with `EndorserBlock` (ordered transaction references: `TxRefHash` and declared size), `Announcement`, `Vote`, and `Certificate`, per the sketches in the plan.
460463

461464
- [ ] Records and `DecEq` instances; EB identifier via `hashEBRefs`.
465+
- [ ] References carry `TxRefHash`, not `TxId`: the body-identity `TxId` cannot pin witnesses, while CIP-164 Appendix B fixes the reference hash over the complete transaction bytes (established in the m1-2 review; `LeiosAbstract` already provides the carrier and `hashEBRefs : List (TxRefHash × ℕ) → EBHash`). `EndorserBlock` is therefore `List (TxRefHash × ℕ)`.
462466
- [ ] Module prose marks the EB-identifier boundary as a known conformance cliff: the identifier is `hashEBRefs` of the reference structure with the byte-exact preimage deliberately unpinned; pinning it is a named follow-up prerequisite for conformance testing (Cardano precedent: the block-body hash's segmented preimage exists only in implementation internals).
463467
- [ ] Decide the duplicate-freedom representation (validity condition versus proof field) and record the choice in module prose.
464468
- [ ] Module prose maps each type to its CIP-164 CDDL counterpart (Appendix B), including the note that the header's `certified_eb` bit is spec-derived.

0 commit comments

Comments
 (0)