Files
eranos/src
Alex Gleason 774305f799 Use nsec directly as BIP-32 seed (NIP-SP §2.2)
Drop the HKDF stretch from both wallets. The 32 bytes of nsec are now
fed straight to BIP-32's master step:

  master = HMAC-SHA512("Bitcoin seed", nsec)
  bip86  = master / 86'  / 0' / 0' / chain / index
  bip352 = master / 352' / 0' / 0' / {0',1'} / 0

For silent payments this matches NIP-SP §2.2 exactly — Agora's sp1q…
is now interoperable with every other NIP-SP-compliant client (Ditto,
reference implementations) for the same nsec.

BIP-86 also moves to direct nsec → BIP-32 for symmetry. BIP-32's
hardened derivation at the purpose level (86' vs 352') already
provides cryptographic isolation between the two branches; the HKDF
sub-tags were redundant with that guarantee.

Trade-off: the previous HKDF design domain-separated the Bitcoin
sub-system from the nsec's other uses (Schnorr signing, NIP-04 ECDH,
NIP-44 ECDH). That property is dropped in favor of spec compliance
and recoverability from nsec alone. In practice the operations on
nsec across these protocols are independent enough that no known
interaction leaks the scalar through any one of them.

Existing wallet addresses change (the seed bytes change); since this
feature has no users yet, no migration is needed.
2026-05-21 18:38:36 -05:00
..
2026-04-30 13:19:22 +07:00
2026-04-17 16:22:33 +05:45
2026-05-13 18:35:03 -05:00