cryptography
Cryptography is the mathematical foundation of Bitcoin. Hash functions, public and private keys, and digital signatures work together to make transactions verifiable and secure without requiring anyone to trust a central authority.
Cryptography is the branch of mathematics concerned with securing information and communication. Bitcoin does not rely on banks or governments to verify transactions. Instead, it uses cryptographic tools that anyone can check independently. Three of these tools are central to how Bitcoin works: hash functions, public and private key pairs, and digital signatures.
A hash function takes any input and produces a fixed-length output called a hash or digest. SHA-256, the function used in Bitcoin, always produces a 256-bit output. Changing even a single character in the input produces a completely different hash. This makes hashes useful for verifying data integrity and forms the basis of Bitcoin mining, where miners must repeatedly hash data until they find an output that meets a specific target. Public and private key cryptography works differently. A private key is a large random number that only the owner knows. A corresponding public key is derived from it mathematically and can be shared openly. The bitcoin address a person shares with others is derived from their public key. Because the relationship between private and public key is one-way, knowing the public key or address gives no information about the private key.
A digital signature ties these elements together. When sending bitcoin, the sender uses their private key to sign the transaction. Anyone on the network can verify this signature using the sender's public key, confirming that the transaction was authorised by the owner of those funds without ever revealing the private key. This combination makes Bitcoin trustless: transactions are secured by mathematics rather than by institutions, and every participant can independently verify every claim.