How do Bitcoin Transactions Work?

von Satoshi Nakamoto

Last updated: 29th January 2018

Simple version:

If I want to send some of my bitcoin to you, I publish my intention and the nodes scan the entire bitcoin network to validate that I 1) have the bitcoin that I want to send, and 2) haven't already sent it to someone else. Once that information is confirmed, my transaction gets included in a "block" which gets attached to the previous block - hence the term "blockchain." Transactions can't be undone or tampered with, because it would mean re-doing all the blocks that came after.

Getting a bit more complicated:

My bitcoin wallet doesn't actually hold my bitcoin. What it does is hold my bitcoin address, which keeps a record of all of my transactions, and therefore of my balance. This address – a long string of 34 letters and numbers – is also known as my "public key."  I don't mind that the whole world can see this sequence. Each address/public key has a corresponding "private key" of 64 letters and numbers. This is private, and it's crucial that I keep it secret and safe. The two keys are related, but there's no way that you can figure out my private key from my public key.

That's important, because any transaction I issue from my bitcoin address needs to be "signed" with my private key. To do that, I put both my private key and the transaction details (how many bitcoins I want to send, and to whom) into the bitcoin software on my computer or smartphone.

With this information, the program spits out a digital signature, which gets sent out to the network for validation.

This transaction can be validated – that is, it can be confirmed that I own the bitcoin that I am transferring to you, and that I haven't already sent it to someone else – by plugging the signature and my public key (which everyone knows) into the bitcoin program. This is one of the genius parts of bitcoin: if the signature was made with the private key that corresponds to that public key, the program will validate the transaction, without knowing what the private key is. Very clever.

The network then confirms that I haven't previously spent the bitcoin by running through my address history, which it can do because it knows my address (= my public key), and because all transactions are public on the bitcoin ledger.

Even more complicated:

Once my transaction has been validated, it gets included into a "block," along with a bunch of other transactions.

A brief detour to discuss what a "hash" is, because it's important for the next paragraph: a hash is produced by a "hash function," which is a complex math equation that reduces any amount of text or data to 64-character string. It's not random – every time you put in that particular data set through the hash function, you'll get the same 64-character string. But if you change so much as a comma, you'll get a completely different 64-character string. This whole article could be reduced to a hash, and unless I change, remove or add anything to the text, the same hash can be produced again and again. This is a very effective way to tell if something has been changed, and is how the blockchain can confirm that a transaction has not been tampered with.

Back to our blocks: each block includes, as part of its data, a hash of the previous block. That's what makes it part of a chain, hence the term "blockchain." So, if one small part of the previous block was tampered with, the current block's hash would have to change (remember that one tiny change in the input of the hash function changes the output). So if you want to change something in the previous block, you also have to change something (= the hash) in the current block, because the one that is currently included is no longer correct. That's very hard to do, especially since by the time you've reached half way, there's probably another block on top of the current one. You'd then also have to change that one. And so on.

This is what makes Bitcoin virtually tamper-proof. I say virtually because it's not impossible, just very very, very, very, very difficult and therefore unlikely.

Fun

And 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 if you want a hypnotically fun version, try BitBonkers.

(For more detail on how blocks are processed and on how bitcoin mining works, see this article.)

NEXT: IS BITCOIN LEGAL?


INDEX: A BEGINNERS GUIDE TO BITCOIN AND BLOCKCHAIN TECHNOLOGY



What is Bitcoin?
It's a decentralized digital currency


Why Use Bitcoin?
It's fast, cheap to use, and secure


How Can I Buy Bitcoin?
From an exchange or an individual


How to Buy Bitcoin in the UK
Buying bitcoin in the UK


How to Store Your Bitcoin
Use a digital or paper wallet


What Can You Buy with Bitcoin?
Spend your bitcoins


How to Sell Bitcoin
A guide on how to sell your bitcoins


How to Accept Bitcoin Payments for Your Store
Learn about bitcoin POS systems


How do Bitcoin Transactions Work?
Bitcoin addresses and private keys


Is Bitcoin Legal?
The current regulation around bitcoin


Who is Satoshi Nakamoto?
The founder of bitcoin


How Bitcoin Mining Works
By confirming transactions


How to Set Up a Bitcoin Miner
Generate bitcoins yourself


What are Bitcoin Mining Pools?
What are pools how and how to join them?


How Does Cloud Mining Bitcoin Work?
Alternative bitcoin mining solutions


How to Calculate Mining Profitability
Can you make a ROI?


How to Make a Paper Bitcoin Wallet
Creating an unhackable bitcoin wallet


Can Bitcoin Scale?
A look at the debate and the tech


What is SegWit?
A new way of storing transaction data


What is the Lightning Network?
Off-chain transaction channels


What is Bitcoin Cash?
Same blockchain, different characteristics.


Hard Fork vs Soft Fork
Why and how do blockchains split?


What is the Difference Between Litecoin and Bitcoin?
It's the silver to bitcoin's gold


How to Buy Litecoin
How to buy the bitcoin alternative litecoin


How to Mine Litecoin and other Altcoins
How to generate your own altcoins


Understanding Bitcoin Price Charts
A primer on bitcoin price charts


Bitcoin E-Commerce Services for Merchants
How to accept bitcoin at your business


What is Blockchain Technology?
A system of distributed data and logic


How Does Blockchain Technology Work?
Cryptographic keys, distributed networks and network servicing protocols


What Can a Blockchain Do?
Identity, recordkeeping, smart contracts and more


What is a Distributed Ledger?
A dynamic, independently maintained database


What is the Difference Between Public and Permissioned Blockchains?
Can anyone read or write to the ledger?


What is the Difference Between a Blockchain and a Database?
It begins with architectural and administrative decisions


What Are the Applications and Use Cases of Blockchains?
Tokenization, auditing, governance, settlement and more


How Could Blockchain Technology Change Finance?
Cross-border payments, new asset classes, regulatory compliance and more


What are Blockchain's Issues and Limitations?
Complexity, size, costs, speed, security, politics and more


Why Use a Blockchain?
To manage and secure digital relationships as part of a system of record


What is Ethereum?
A blockchain application platform and 'world computer'


What is Ether?
The 'fuel' of the ethereum network


How to Use Ethereum
Wallets, trading and ‘dapps’


Who Created Ethereum?
Vitalik Buterin


How Ethereum Mining Works
'Proof of Work' and 'Proof of Stake'


How to Mine Ethereum
GPUs, mining software and pools


How Ethereum Works
'Turing-complete' programming, 'state' and the 'EVM'


What is a Decentralized Application?
A distributed 'smart contract' system


What is a DAO?
A 'decentralized autonomous organization'


How Do Ethereum Smart Contracts Work?
Code, transaction fees and 'gas'


How Will Ethereum Scale?
‘Sharding’ and ‘off-chain’ transactions


What is an ICO?
Initial Coin Offerings refer to the distribution of digital tokens.

Read the full article
Porträt von Satoshi Nakamoto

Satoshi Nakamoto

Zur Person

Satoshi Nakamoto