Derive cbk keys with BIP85 instead of an ad hoc HKDF label

The private key is now the BIP85 HEX application output for 32 bytes at
m/83696968'/128169'/32'/{index}' from the BIP32 master key of the BIP39
seed, via sneak.berlin/go/secret/pkg/bip85, so any BIP85 tool reproduces
it and one mnemonic backs many keypairs through Params.Index. Tests
check the mnemonic-to-master step and the HEX application against the
BIP85 specification vectors and pin the resulting keypair.
This commit is contained in:
2026-10-31 11:38:02 -07:00
parent ea6faaecff
commit fe6dbba428
5 changed files with 312 additions and 64 deletions
+6
View File
@@ -3,6 +3,8 @@ module sneak.berlin/go/x
go 1.26.0
require (
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcutil v1.1.6
github.com/kavfixnel/words v1.0.0
github.com/mitchellh/go-homedir v1.1.0
github.com/spf13/cobra v1.10.2
@@ -10,9 +12,13 @@ require (
github.com/stretchr/testify v1.12.1
github.com/tyler-smith/go-bip39 v1.1.0
golang.org/x/crypto v0.58.0
sneak.berlin/go/secret v1.0.0-rc4
)
require (
github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect