Skip to content

GENESIS: git mark init reads nostr.voucher to seed the first gitmark.txo #42

@melvincarvalho

Description

@melvincarvalho

Re-scoped against the funding contract — see FUNDING.md (#43, PR #44). The original framing ("auto-discover base-key funding from .well-known/txo/txo.json") was reaching for the publish-mode artifact; the contract gives a cleaner seam.

The seam (per the contract)

nostr.voucher (bootstrap, written by fund-agent) and gitmark.txo (the running tip, gitmark-managed) are two distinct roles. They meet at exactly one point:

git mark init (GENESIS) reads nostr.voucher, sweeps it onto the repo's own key, and seeds the first gitmark.txo.

After that gitmark owns the tip; the voucher is spent and never re-read.

What to implement

  • On git mark init, if gitmark.txo is unset, read git config --local nostr.voucher (a bearer txo:…?…&key= URI), sweep it to the repo's own key, and write the resulting output to gitmark.txo.
  • If no nostr.voucher and no gitmark.txo: unfunded — print the base address to fund (current behaviour).
  • --voucher <uri|file> stays as the explicit override for the same sweep.

Not this

  • Reading .well-known/txo/txo.json is publish-mode only convenience, not the default path. The default handoff is the nostr.voucher config field.
  • No dependence on fund-agent's internal namespace beyond the agreed nostr.voucher field.

Depends on

Symptom this fixes

Funding a repo then git markNo funding. Run: git mark init --voucher txo:..., because nothing bridged the funded output into gitmark.txo. With this, GENESIS does the bridge automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions