Private key – Mangrove

GlossaryWallets and custody

Private key

Definition: A private key is the secret half of a cryptographic key pair; on a blockchain, it signs the transactions that authorize moving an account's funds.

Bitcoin and Ethereum use public-key cryptography, in which keys come in pairs and a pair controls an Ethereum account or a Bitcoin address. The private key stays secret and produces digital signatures. The public key is computed from the private key and lets others check those signatures. The computation runs one way only: ethereum.org’s developer documentation says “you cannot derive a private key from public keys”. An address is a shorter identifier that others use to send funds. It is derived from the public key with a hash, the fixed-length output of a function designed so that no one can feasibly work back from an output to its input (glossary of the US National Institute of Standards and Technology). On Ethereum, the address is the last 20 bytes of that hash, with 0x added at the front (ethereum.org). An investor bulletin from the staff of the US Securities and Exchange Commission (SEC) warns that “If you lose your private key, you permanently lose access to the crypto assets in your wallet” (SEC investor bulletin). Many wallets derive their keys from a seed phrase, a separate entry, and can recreate a lost key from it. For example, an AI agent that signs its own trades may keep a private key on the machine it runs on, and anyone who copies the key from that machine may then sign transfers from the same account.

Bitcoin’s developer guide says Bitcoin uses the Elliptic Curve Digital Signature Algorithm (ECDSA), a method for producing and checking digital signatures, “with the secp256k1 curve”, a published set of mathematical parameters (curve parameters), and that secp256k1 private keys “are 256 bits of random data” (Bitcoin developer guide). ethereum.org says an Ethereum public key is generated from the private key with ECDSA, and that the private key is “made up of 64 hex characters”. Hex, short for hexadecimal, writes numbers in base 16, so each character stands for 4 bits and 64 characters make 256 bits.

Whitfield Diffie and Martin Hellman proposed public key cryptosystems in New Directions in Cryptography (IEEE Transactions on Information Theory, November 1976). In their design, each user publishes an enciphering key and deciphers messages “using his own secret deciphering key”. They also described how such a system could give a digital signature: a message transformed with a user’s secret key could be checked by anyone with that user’s public key, so the receiver “can read it, and be assured of its authenticity”.