Documentation
¶
Overview ¶
Package ptype holds the frozen registry of proof type integer codes used by Truestamp proof bundles. The registry discriminates both subject types (bundle["t"]) and external commitment chain types (bundle["cx"][].t).
The registry is a long-lived contract:
- Existing codes are never reused or renumbered.
- New codes claim unused integers in the appropriate category.
Category ranges (blocks of 10):
10-19 subject: block family (10 = block, 11 = beacon) 20-29 subject: item 30-39 subject: entropy sources 40-49 external commitment chains 50+ reserved for future categories
Beacon (t=11) shares the block structural shape — no `s`, no `ip`, same `b` + `cx` — but is a distinct type code for domain separation. Because `t` is part of the signing payload, a t=10 and t=11 bundle for the same block produce different signatures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Humanize ¶
Humanize returns a display-friendly label for a code, used in the pretty verify output.
func IsBlockLikeSubject ¶
IsBlockLikeSubject reports whether c is a block-family subject type — either a plain block (t=10) or a beacon (t=11). The two share the same wire shape: no `s`, no `ip`, `subject_hash == block_hash`. Verification branches that skip subject / inclusion-proof / subject-hash-derivation steps should key off this helper rather than `c == Block`.
func IsEntropySubject ¶
IsEntropySubject reports whether c is one of the entropy subject types.
func IsValidExternalCommitment ¶
IsValidExternalCommitment reports whether c is a registered external commitment type code.
func IsValidSubject ¶
IsValidSubject reports whether c is a registered subject type code.
Types ¶
type Code ¶
type Code uint16
Code is the integer type code used to identify the subject of a proof bundle or the chain of an external commitment. Codes are u16 on the wire (in the signed payload); all currently-registered codes fit in one byte.