How Do Bitcoin Transactions Work?

Bitcoin transactions are sent from and to electronic bitcoin wallets, and are digitally signed for security.

Updated Dec 6, 2022 at 6:28 p.m. UTC

Now that you’ve set up your bitcoin wallet and are ready to make your first transaction, let’s take a look at how bitcoin transactions actually work.

There are three key variables in any bitcoin transaction: an amount, an input and an output. An input is the address from which the money is sent, and an output is the address that receives the funds. Since a wallet can contain several input addresses, you can send money from one or more inputs to one or more outputs. There is also a data storage portion on each transaction, a sort of note, that allows you to record data to the blockchain immutably.

But the unique thing about bitcoin transactions is that, if you initiate a transaction that’s worth less than the total amount in your input, you get your change back not to your original output, but through a new third address in your control. This means your wallet typically ends up containing multiple addresses, and you can pull funds from these addresses to make future transactions.

You’ve learned how to buy and store your bitcoins, so you already know what public and private keys are for, and you’ll need these to issue a transaction. To do that, you put your private key, the amount of bitcoins you want to send and the output address into the bitcoin software on your computer or smartphone.

Then the program generates a signature made from your private key to announce this transaction to the network for validation. The network needs to confirm that you own the bitcoin being transferred and that you haven’t spent it by checking all previous transactions which are public on the ledger. Once the bitcoin program verifies that indeed your private key corresponds to the provided public key (without knowing what your private key is), your transaction is confirmed.

This transaction is now included in a “block” which gets attached to the previous block to be added to the blockchain. Every transaction in the blockchain is tied to a unique identifier called a transaction hash (txid), which looks like a 64-character string of random letters and numbers. You can track a particular transaction by typing this txid in the search bar on the blockchain explorer.

Transactions can’t be undone or tampered with, because it would mean re-doing all the blocks that came after. This process is not instantaneous. Because the bitcoin blockchain is fairly large, it takes a lot of time to process a single transaction among the many on the blockchain.

The amount of time it takes to confirm a transaction varies, ranging anywhere from a few minutes to a couple days, based on traffic on the blockchain and the size of your transaction. Larger transactions with higher fees tend to get validated by miners quicker than smaller ones. That said, once it is confirmed, it is immutably recorded forever.

If you want to indulge in some mindless fascination, you can sit at your desk and watch bitcoin transactions float by. Blockchain.info is good for this, but try BitBonkers if you want a hypnotically fun version.

This article was originally published on Aug 20, 2013 at 8:59 p.m. UTC

Disclosure

Please note that our privacy policy, terms of use, cookies, and do not sell my personal information has been updated.

CoinDesk is an award-winning media outlet that covers the cryptocurrency industry. Its journalists abide by a strict set of editorial policies. In November 2023, CoinDesk was acquired by the Bullish group, owner of Bullish, a regulated, digital assets exchange. The Bullish group is majority-owned by Block.one; both companies have interests in a variety of blockchain and digital asset businesses and significant holdings of digital assets, including bitcoin. CoinDesk operates as an independent subsidiary with an editorial committee to protect journalistic independence. CoinDesk employees, including journalists, may receive options in the Bullish group as part of their compensation.

Noelle Acheson

Noelle Acheson is the former head of research at CoinDesk and Genesis Trading. This article is excerpted from her Crypto Is Macro Now newsletter, which focuses on the overlap between the shifting crypto and macro landscapes. These opinions are hers, and nothing she writes should be taken as investment advice.


Learn more about Consensus 2024, CoinDesk's longest-running and most influential event that brings together all sides of crypto, blockchain and Web3. Head to consensus.coindesk.com to register and buy your pass now.