Skip to content

The derivation rule as it is: additive on the full point, BIP 341's hash but not its derivation; the git-mark profile as the live trails use it - #6

Merged
melvincarvalho merged 2 commits into
gh-pagesfrom
rule-as-it-is
Oct 1, 2026
Merged

melvincarvalho merged 2 commits into
gh-pagesfrom
rule-as-it-is

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Closes #5; the profile part addresses blocktrails/git-mark#2.

spec.md

  • Key Representation: the tweak is added to the point as it is, never its even-y lift (d + t ↔ P + t·G exact at every step); the base key is published as a full compressed point; a bare x-only base is the even-y point and its holder normalises the secret once; the rule is stated and tested once in sidestr/spec siding/lib/keys.mjs.
  • Benefits: "Standards alignment: Compatible with BIP-341" replaced by what is true: BIP 341's tagged hash, not BIP 341's derivation; a trail output is a raw taproot key (rawtr()), reproducible from the base point and the states, not derivable by a descriptor wallet or a device from an internal key and a merkle root.
  • p2tr_xonly(P) is x(P) (the branch was a no-op); the BIP 340 sign is applied inside the signing only.
  • Verify: every link MUST be checked, not the head alone (plain addition commutes; the intermediate outputs pin each state).

profiles/gitmark.html — made to describe the rule the live trails actually follow, established against the chain (every sampled mark of a 68-mark trail of 1 October 2026 matches, through 35 odd-y intermediate points):

  • scalar(P, commit) is the Core scalar with the state serialised as the commit's 40 hex characters as UTF-8 text: h = sha256(utf8(commit)), t = TapTweak(x(P) || h), on the full point. The earlier text hashed the 20 raw bytes; no trail was made that way.
  • Every TXO carries its commit, the genesis one too; the base key is never an output and is published as pubkeyBase (full compressed point).
  • The verification algorithm takes pubkeyBase, walks every link, and no longer tries both parities.

Figures and method: the audit in #5; the live-trail check compared recomputed outputs with the on-chain scriptpubkey of marks 0, 1, 2, 10, 33, 50, 66 and 67.

…itive on the full point (not BIP 341's); the base key published as a full compressed point, a bare x the even-y point with the secret normalised once; p2tr_xonly is x(P), the sign only at signing; every link verified; the git-mark profile describes the rule the live trails follow (state = the commit as text, every TXO carries a commit, no parity guessing) (closes #5)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The git-mark profile's new mandatory-commit/full-base-key model is not applied consistently — the genesis example drops pubkey, the URI grammar and txo.json example still treat commit as optional, and blocktrails.json is referenced but never defined.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

This documentation-only PR corrects the cryptographic claims in the Blocktrails spec and its git-mark profile to match what implementations and live trails actually do. In spec.md it stops claiming BIP-341 compatibility for the derivation (clarifying that only the TapTweak hash is BIP 341's, while the tweak is added to the point as-is, never its even-y lift), simplifies p2tr_xonly(P) to x(P), and strengthens the verification wording to require checking every link. In profiles/gitmark.html it redefines the git-mark scalar input as the SHA-256 of the 40-char hex commit as UTF-8 text, makes every TXO (genesis included) carry a commit, publishes the base key as a full compressed point (pubkeyBase), and rewrites the verification algorithm to walk from pubkeyBase without trying both parities.

Changes:

  • Replace the "Compatible with BIP-341" claim with an accurate statement (BIP 341's hash, not its derivation) and document full-point additive tweaking plus base-key publication.
  • Simplify p2tr_xonly to x(P) and move the BIP-340 sign handling into signing only.
  • Update the git-mark profile's scalar input, genesis-commit rule, and verification algorithm to match live trails.
File Description
spec.md Clarifies additive full-point derivation vs BIP-341, publishes full base key, simplifies p2tr_xonly, and tightens verify wording.
profiles/​gitmark.html Redefines scalar input (UTF-8 hex commit), requires a commit on every TXO, publishes pubkeyBase, and rewrites the verification algorithm.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread profiles/gitmark.html
<tr><td>amount</td><td>integer</td><td>Value in satoshis</td></tr>
<tr><td>pubkey</td><td>hex64</td><td>X-only pubkey (64 hex characters)</td></tr>
<tr><td>commit</td><td>hex40</td><td>Git commit hash (absent for genesis)</td></tr>
<tr><td>commit</td><td>hex40</td><td>Git commit hash: every TXO carries one, the genesis TXO too</td></tr>
Comment thread profiles/gitmark.html
<h3>3.1 Genesis TXO</h3>
<p>The genesis TXO has no <code>commit</code> parameter. Its pubkey is the base pubkey <code>P₀</code>:</p>
<pre><code>txo:tbtc4:34cea31b...e854be0e:0?amount=1000000&amp;pubkey=3e458cc6...a5c8cf</code></pre>
<p>The genesis TXO carries the first commit; its pubkey is the base key tweaked by it, <code>x(P_base + scalar(P_base, commit₀) × G)</code>. The base key itself is never an output: it is published with the trail (<code>pubkeyBase</code> in <code>blocktrails.json</code>) as a full compressed point, <code>02</code>/<code>03</code> + x, so a verifier has nothing to guess.</p>
…mar and txo.json example; blocktrails.json documented as where the base key is published (Copilot review)
@melvincarvalho

Copy link
Copy Markdown
Contributor Author

Addressed: the URI grammar now has commit required and pubkey optional (a verifier recomputes it), the txo.json example carries a commit on every entry, and a new 5.2 documents blocktrails.json (base key as a full point, states, TXO URIs) as where pubkeyBase is published; the directory structure lists it.

@melvincarvalho
melvincarvalho merged commit 5f32d92 into gh-pages Oct 1, 2026
@melvincarvalho
melvincarvalho deleted the rule-as-it-is branch October 1, 2026 16:38
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.

Drop the "compatible with BIP-341" claim: the tweak hash is BIP 341's, the derivation is additive on the full point; publish the full base key

2 participants