Drop the BIP39 passphrase from cbk
The seed is always computed with an empty passphrase; Params is just the mnemonic and the BIP85 index.
This commit is contained in:
@@ -66,9 +66,9 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// The same mnemonic (and optional passphrase) always yields the same
|
||||
// keypair, on any machine. The keys are plain crypto_box keys for use
|
||||
// with golang.org/x/crypto/nacl/box.
|
||||
// The same mnemonic always yields the same keypair, on any machine.
|
||||
// The keys are plain crypto_box keys for use with
|
||||
// golang.org/x/crypto/nacl/box.
|
||||
keypair, err := cbk.New(cbk.Params{Mnemonic: mnemonic})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
@@ -138,8 +138,8 @@ independent keypairs:
|
||||
1. The mnemonic is validated and canonicalized with
|
||||
`bip39wordlist.NormalizeWordlist`.
|
||||
2. The standard 64-byte BIP39 seed is computed with PBKDF2-HMAC-SHA512 (2048
|
||||
rounds, salt `"mnemonic" + passphrase`), exactly as a BIP39 wallet would, so
|
||||
the optional passphrase works as the usual "25th word".
|
||||
rounds, salt `"mnemonic"`), exactly as a BIP39 wallet would with an empty
|
||||
passphrase. BIP39 passphrases are deliberately not supported.
|
||||
3. The seed becomes a BIP32 master key.
|
||||
4. BIP85's HEX application derives 32 bytes of entropy at
|
||||
`m/83696968'/128169'/32'/{index}'`; those bytes are the private key.
|
||||
@@ -148,8 +148,8 @@ independent keypairs:
|
||||
The resulting keys are plain 32-byte crypto_box keys for use with
|
||||
`golang.org/x/crypto/nacl/box`. The API:
|
||||
|
||||
- `cbk.New(cbk.Params{Mnemonic, Passphrase, Index})` and `cbk.FromMnemonic(m)`
|
||||
(no passphrase, index 0) return a `CryptoBoxKeypair`.
|
||||
- `cbk.New(cbk.Params{Mnemonic, Index})` and `cbk.FromMnemonic(m)` (index 0)
|
||||
return a `CryptoBoxKeypair`.
|
||||
- `CryptoBoxKey.Hex()`, `CryptoBoxKey.Bytes()`, and the `PublicKeyHex`,
|
||||
`PrivateKeyHex`, `PublicKeyBytes`, `PrivateKeyBytes` accessors on the keypair.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user