Learn Bitcoin is live in Beta - spot an issue or have a suggestion? We'd love to hear it!
Home Glossary C Chaincode

Chaincode

In HD wallets (BIP 32), a 256-bit value paired with a parent key to derive child keys deterministically.
Share

Chaincode is essentially the ‘secret sauce’ used alongside a parent private/public key to generate a hierarchy of child keys in the BIP 32 scheme. When you derive a child key, you combine the parent key with the chaincode via HMAC-SHA512, producing the child’s private (or public) key and new chaincode.

This mechanism ensures that a single seed can produce countless keys without revealing the master private key. By splitting the derivation data into a key and chaincode, HD wallets can securely manage advanced setups like separate accounts or layered passphrases. Chaincode never changes arbitrarily; it remains consistent once it’s generated at each step in the derivation path.

Key takeaways
Paired with a key to deterministically create child keys
Central to hierarchical deterministic wallet design (BIP 32)
Protects the master seed while enabling multiple derivation paths
Learn Bitcoin visual
Learn how to

Be Your Own Bank

Be Your Own Bank teaches you how to securely store and manage your Bitcoin, giving you full control over your finances. Unlock the power of self-custody and financial sovereignty, so you can confidently operate without intermediaries.

Take the Survey
30 sec
Free
Suggest a Term

Have a term to suggest? Enter it below and help us expand our vocabulary!