You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section shows the direct use of `bip32.GenerateHDKeyPair`. This function creates a new master HD key from a randomly generated seed of the given length. It returns the extended private key (xPriv) and the corresponding extended public key (xPub) as strings.
@@ -35,11 +35,11 @@ To run this example:
35
35
```bash
36
36
go run generate_hd_key.go
37
37
```
38
-
The output will be the newly generated xPrivateKey and xPublicKey strings. Each run will produce a different key pair.
38
+
The output will confirm the generated key lengths and show a short fingerprint of the xPub. Each run will produce a different key pair, so securely store the raw keys instead of logging them.
39
39
40
40
**Note**:
41
-
- The generated xPrivateKey is the master private key for an HD wallet structure. It should be kept extremely secure.
42
-
- The xPublicKey can be used to derive child public keys without exposing the private key.
41
+
- The generated xPrivateKey is the master private key for an HD wallet structure. It should be kept extremely secure and never logged in plaintext.
42
+
- The xPublicKey can be used to derive child public keys without exposing the private key. Only expose fingerprints when confirming values in logs.
43
43
-`bip32.SecureSeedLength` is typically 32 bytes (256 bits) or 64 bytes (512 bits) for strong security.
0 commit comments