Nodes validate and broadcast transactions, each maintaining a copy of the blockchain for ownership verification. A new block is created every 10 minutes on average, updating the blockchain across all nodes without central oversight. This process tracks bitcoin spending,
ensuring each bitcoin is spent only once. Unlike a traditional ledger that tracks physical currency, bitcoins exist digitally as unspent outputs of transactions.]
Addresses and transactions
Simplified chain of ownership. In practice, a transaction can have more than one input and more than one output.
In the blockchain, bitcoins are linked to specific addresses that are hashes of a public key. Creating an address involves generating a random private key and then computing the corresponding address. This process is almost instant, but the reverse (finding the private key for a given address) is nearly impossible.]: ch. 4 Publishing a bitcoin address does not risk its private key, and it is extremely unlikely to accidentally generate a used key with funds. To use bitcoins, owners need their private key to digitally sign transactions, which are verified by the network using the public key, keeping the private key secret.]: ch. 5
Bitcoin transactions use a Forth-like scripting language,]: ch. 5 involving one or more inputs and outputs. When sending bitcoins, a user specifies the recipients' addresses and the amount for each output. This allows sending bitcoins to several recipients in a single transaction. To prevent double-spending, each input must refer to a previous unspent output in the blockchain. Using multiple inputs is similar to using multiple coins in a cash transaction. As in a cash transaction, the sum of inputs can exceed the intended sum of payments. In such a case, an additional output can return the change back to the payer. Unallocated input satoshis in the transaction become the transaction fee.
Losing a private key means losing access to the bitcoins, with no other proof of ownership accepted by the protocol.[24] For instance, in 2013, a user lost ₿7,500, valued at US$7.5 million, by accidentally discarding a hard drive with the private key.[66] It is estimated that around 20% of all bitcoins are lost.[67] The private key must also be kept secret as its exposure, such as through a data breach, can lead to theft of the associated bitcoins.]: ch. 10 [68] As of December 2017, approximately ₿980,000 had been stolen from cryptocurrency exchanges.[69]
Mining
See also: Bitcoin protocol § Mining
Bitcoin mining facility with large amounts of mining hardware
The mining process in Bitcoin involves maintaining the blockchain through computer processing power. Miners group and broadcast new transactions into blocks, which are then verified by the network. Each block must contain a proof of work (PoW) to be accepted, involving finding a nonce number that, combined with the block content, produces a hash numerically smaller than the network's difficulty target.]: ch. 8 This PoW is simple to verify but hard to generate, requiring many attempts.]: ch. 8 PoW forms the basis of Bitcoin's consensus mechanism.
The difficulty of generating a block is deterministically adjusted based on the mining power on the network by changing the difficulty target, which is recalibrated every 2,016 blocks (approximately two weeks) to maintain an average time of ten minutes between new blocks. The process requires significant computational power and specialized hardware.]: ch. 8 [71]
Miners who successfully find a new block can collect transaction fees from the included transactions and a set reward in bitcoins.[72] To claim this reward, a special transaction called a coinbase is included in the block, with the miner as the payee. All bitcoins in existence have been created through this type of transaction.]: ch. 8 This reward is halved every 210,000 blocks until ₿21 million,[b] with new bitcoin issuance slated to end around 2140. Afterward, miners will only earn from transaction fees. These fees are determined by the transaction's size and the amount of data stored, measured in satoshis per byte.]: ch. 8
The proof of work system and the chaining of blocks make blockchain modifications very difficult, as altering one block requires changing all subsequent blocks. As more blocks are added, modifying older blocks becomes increasingly challenging.[74][62] In case of disagreement, nodes trust the longest chain, which required the greatest amount of effort to produce.[70] To tamper or censor the ledger, one needs to control the majority of the global hashrate.[70] The high cost required to reach this level of computational power guarantees the security of the bitcoin blockchain.[70]