Skip to content

docs(brc220): draft the certificate field values, as the reference writes them - #167

Merged
codenlighten merged 3 commits into
mainfrom
docs/brc220-certificate-fields
Sep 11, 2026
Merged

codenlighten merged 3 commits into
mainfrom
docs/brc220-certificate-fields

Conversation

@codenlighten

Copy link
Copy Markdown
Owner

Adds docs/BRC220_CERTIFICATE_FIELDS_AMENDMENT.md, a draft BRC-220 amendment that defines the certificate's field values. It is not filed upstream.

BRC-220 §Certificate names twelve required fields and defines none of their values. That is how @smartledger/bsv 8.3.0–9.8.0 and the reference implementation computed identical proofHash values and could not verify each other's certificates. The draft proposes the values the reference writes:

  • version "1.0"
  • mode "full"/"hybrid", with batching marked on anchor.type
  • encoding "hex"/"base64", applying to publicKey and signature only
  • lowercase, unprefixed hex
  • createdAt as ISO 8601 with zero milliseconds
  • the six anchor members
  • { hash, side } audit paths, with the fold rule
  • the byte order of the SPV fields
  • the ECDSA byte forms

It is drafted as a separate PR from bsv-blockchain/BRCs#246, which is under review and narrow.

How the claims were checked. Every value comes from the reference's source at b926e3b: certificate assembly, the batcher, the confirmation poller and the schema. They agree with the reference's own protocol document. The behavioural claims were run against the reference's own code: a "version": "2.0" certificate passes all of its checks, unknown members pass its schema, any network string passes, and base64 invalid characters are silently skipped. Where its verifier is more lenient than its writer, the draft lists an open point for the author rather than deciding.

Guarding the examples. The two examples are certificates the reference produced. test/notaryhash/fields_amendment.js reads them out of the markdown and checks them against test/data/notaryhash-reference-certs.json. It also verifies their signature and proofHash, folds the batch path by hand, and checks that every field and member has a table row.

npm test: 4955 passing.

…ites them

BRC-220 names the twelve fields a certificate carries and defines none of
their values. That is how this library, 8.3.0-9.8.0, and the reference
implementation computed identical proofHashes and could not verify each
other's certificates.

The draft proposes the values the reference writes: version "1.0", mode
"full"/"hybrid" with batching on anchor.type, encoding "hex"/"base64" for
publicKey and signature only, lowercase unprefixed hex, createdAt as ISO 8601
with zero milliseconds, the six anchor members, { hash, side } audit paths,
the byte order of the SPV fields, and the ECDSA byte forms. Where the
reference's verifier is more lenient than its writer (version is never
checked, base64 skips invalid characters, network is any string), the
difference is listed as an open point, not decided.

The examples are certificates the reference produced, and a test reads them
out of the document and checks them against that fixture. Not filed.
Two reader rules join the proposed text: a verifier refuses a version it
does not implement, and a reader refuses base64 that is not base64. The
reference adopts both, so the spec does not state a rule its own reference
breaks. Hex may be read in upper case and with 0x. network gets two names,
bsv-mainnet and a reserved bsv-testnet, and is descriptive, because the
header the verifier obtains already fixes the chain. Legacy shapes stay out
of the spec, and high-S stays accepted.
…the reader rules

The proposed-text section is now generated from apps/0220.md as committed on
the filing branch, so the two cannot differ. The ECDSA byte forms move into
section Certificate, under the fields they describe: section Algorithms is
where #246 edits, and a trial merge of #246 on top of this change is clean.

The guard test now checks each MUST and MAY sentence twice: that it is in
the text, and that this library does what it says. That includes not
refusing the numeric version 1 of its own legacy format, which it
implements.
@codenlighten
codenlighten force-pushed the docs/brc220-certificate-fields branch from 49bedd9 to 587bf90 Compare September 11, 2026 12:53
@codenlighten
codenlighten merged commit 03574e0 into main Sep 11, 2026
6 checks passed
@codenlighten
codenlighten deleted the docs/brc220-certificate-fields branch September 11, 2026 12:55
codenlighten added a commit that referenced this pull request Sep 11, 2026
… height, and its fields are filed for BRC-220 (#169)

Carries the base64 length rule and the optional header height from #168, and the certificate field definitions from #167, now filed upstream as bsv-blockchain/BRCs#247. The batch-leaf draft says that leafIndex counts from 0 and how i is written in the vector, as review of bsv-blockchain/BRCs#246 asked. Additive, or refuses only malformed input.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant