docs(SEED-VERIFICATION): add the missing FIPS key, fix the comparison commands
Ran the doc's script rather than only reading it, and cross-checked every primitive it implements against independent libraries (bip_utils for BIP-39 seed / BIP-32 derivation / bech32, and cryptography's own HKDF): BIP-39 seed, m/44'/1237'/0'/0/0, m/84'/0'/0', x-only pubkey, npub encoding and HKDF-SHA256(salt=None) all match byte for byte. The hand-rolled crypto in this doc is correct. Two real gaps fixed: - **The FIPS mesh transport key was missing.** `seed.rs:227` derives it from the same master seed via `archipelago/fips/secp256k1/v1`, and a user verifying their backup had no way to check it — despite it being the key that authenticates them on the mesh. Added it to the diagram and as section 2b of the script (same shape as the node Nostr key; verified against `derive_fips_key` and `hkdf_derive` using `Hkdf::new(None, ikm)`). - **The "compare with your node" commands were wrong.** The RPC endpoint is `/rpc/v1`, not `/api/rpc`, and `identity.get-node` is not a method — the real ones are `node.did` and `node.nostr-pubkey`. Also dropped "UI: Settings > Identity", which is not a screen that exists, in favour of the two identity files on disk. Verified and left alone: all five other HKDF info strings, both BIP-32 paths, and the `node_key.pub` filename. The release-root key (`archipelago/release/root/ed25519/v1`) is deliberately still absent — it is derived from the project's signing seed, not a user's node seed. Noted separately: `system.get-node-key` sits in the CSRF-exempt list (`api/rpc/mod.rs:337`) but has no dispatcher arm, so it is an exemption for a method that does not exist. Harmless, but it should be removed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
db60c3382d
commit
623eb0f033
@@ -19,6 +19,9 @@ PBKDF2-HMAC-SHA512 (2048 rounds, salt = "mnemonic")
|
||||
+-- HKDF-SHA256 (info="archipelago/nostr-node/secp256k1/v1")
|
||||
| --> Node Nostr key --> npub1...
|
||||
|
|
||||
+-- HKDF-SHA256 (info="archipelago/fips/secp256k1/v1")
|
||||
| --> FIPS mesh transport key --> npub1...
|
||||
|
|
||||
+-- HKDF-SHA256 (info="archipelago/identity/{i}/ed25519/v1")
|
||||
| --> Identity[i] Ed25519 --> did:key:z...
|
||||
|
|
||||
@@ -265,6 +268,20 @@ def main():
|
||||
print(f" nsec: {bech32_encode('nsec', node_nostr_priv)}")
|
||||
print(f" npub: {bech32_encode('npub', node_nostr_pub)}")
|
||||
|
||||
# ── 2b. FIPS mesh transport key ─────────────────────────────────────
|
||||
|
||||
print()
|
||||
print("-" * W)
|
||||
print(" 2b. FIPS MESH TRANSPORT KEY")
|
||||
print(f" HKDF-SHA256(seed, info='archipelago/fips/secp256k1/v1')")
|
||||
print("-" * W)
|
||||
|
||||
fips_priv = hkdf_sha256(seed, b"archipelago/fips/secp256k1/v1")
|
||||
fips_pub = secp256k1_xonly(fips_priv)
|
||||
|
||||
print(f" X-only: {fips_pub.hex()}")
|
||||
print(f" npub: {bech32_encode('npub', fips_pub)}")
|
||||
|
||||
# ── 3. Identity[0..2] Ed25519 + DID ─────────────────────────────────
|
||||
|
||||
print()
|
||||
@@ -324,10 +341,12 @@ def main():
|
||||
print()
|
||||
print("=" * W)
|
||||
print(" Compare these values with your Archipelago node:")
|
||||
print(" UI: Settings > Identity")
|
||||
print(" SSH: xxd -p /var/lib/archipelago/identity/node_key.pub")
|
||||
print(" RPC: curl -s http://<ip>/api/rpc \\")
|
||||
print(" -d '{\"method\":\"identity.get-node\"}' | jq .")
|
||||
print(" SSH: xxd -p /var/lib/archipelago/identity/node_key.pub (section 1)")
|
||||
print(" cat /var/lib/archipelago/identity/nostr_pubkey (section 2)")
|
||||
print(" RPC: curl -s -b jar.txt http://<ip>/rpc/v1 \\")
|
||||
print(" -H 'Content-Type: application/json' \\")
|
||||
print(" -d '{\"method\":\"node.did\"}' | jq .")
|
||||
print(" ...and {\"method\":\"node.nostr-pubkey\"} for the npub")
|
||||
print("=" * W)
|
||||
print()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user