Expand description
Repo-held git-mark trails and the NIP-34 anchor tags they feed.
A repository can carry its own Blocktrails trail: the agent that owns the
repo marks each commit with the git mark CLI, using the repo’s own key,
and commits the resulting blocktrails.json (profile gitmark). The forge
then holds no key and records nothing. It reads the file at the default
branch tip, re-derives every mark’s taproot address from the base key and
the commits, links each mark to its chain’s explorer, serves the committed
document, and names the latest on-chain mark in its NIP-34 events.
This is the Rust counterpart of the JSS forge plugin’s repo-held trail
path (repoTrail, gitmarkStateHash, anchorTags, blocktrailsResp) and
didShort. JSS is cited by function name only; the implementation is
original, built on solid_pod_rs::blocktrail and
solid_pod_rs::mrc20.
§State bytes
A git-mark trail hashes each state as SHA-256(commit hash as text). The
forge’s own marks hash a JSON record instead. Both use the same chained
BIP-341 TapTweak walk, so the walk is solid_pod_rs::mrc20’s and only
the state strings differ: here they are the commits, verbatim.
§Features
Reading, validating and tagging a trail needs nothing optional. Re-deriving
the per-mark addresses needs the Bitcoin stack and so the anchoring
feature; without it RepoMark::address and RepoMark::program are
None.
Structs§
- Anchor
Facts - The facts a NIP-34 event needs to name a trail’s on-chain frontier.
- Repo
Mark - One mark of a repo-held trail.
- Repo
Trail - A git-mark trail committed to a repository, read and re-derived.
Constants§
- MAX_
TRAIL_ BYTES - Largest
blocktrails.jsonthe forge will read, in bytes. A trail gains one short line per mark, so this admits thousands of marks while bounding the work a hostile push can ask of a page render. - TRAIL_
FILE - The trail document’s name at the repository root.
Functions§
- anchor_
tags - The NIP-34 anchor tags both repository events (kinds 30617 and 30618) carry once a repository is anchored, in emission order.
- did_
short - Shorten a
did:nostrpublic key for display:did:nostr:plus the first eight characters and an ellipsis. The hex stays canonical in every path and identifier; this is for rendering only (JSSdidShort). - explorer_
tx_ url - The explorer page for one transaction, or
Nonewhen the chain has no public explorer ortxidis not 64 lowercase-or-uppercase hex characters. - explorer_
web - The explorer web base for a chain token, for links a person clicks.
- network_
for_ chain - The network name
solid_pod_rs::mrc20::bt_addresstakes for a chain token, orNonefor a chain whose address prefix the encoder does not know (regtestusesbcrt, which it does not emit). - parse_
repo_ trail - Parse a committed
blocktrails.jsonas a repo-held git-mark trail. - read_
repo_ trail - Read the repo-held trail at the tip of
branchin a bare repository, orNonewhen the repository has no validblocktrails.jsonthere.