Skip to main content

Module hd

Module hd 

Source
Expand description

Hierarchical Deterministic (HD) wallet key derivation.

Implements the Webcash HD derivation scheme (compatible with the Python reference implementation). Four chain codes partition the key space:

ChainCodePurpose
Receive0Incoming payments
Pay1Outgoing payment outputs
Change2Transaction change
Mining3Mining reward collection

§Derivation Algorithm

tag = SHA256("webcashwalletv1")
secret = SHA256(tag ‖ tag ‖ master_secret ‖ chain_code_be64 ‖ depth_be64)

Structs§

HDWallet
HD wallet with secure key derivation from a 32-byte master secret.

Enums§

ChainCode
Chain codes for HD wallet derivation.