When you think about it, Bitcoin transactions should be simple: I send money from one Bitcoin address to another. All I need to know is the origin, destination and amount, right? It turns out that Bitcoin transactions are much more complicated than this. We’re going to learn how to read a Bitcoin transaction simply, as well as understand all that gibberish that generally follows.
[tweet_box design=”box_02″]Bitcoin addresses don’t actually exist like you may think they do.[/tweet_box]
The blockchain is not a ledger of all the accounts that exist and their respective balances, but rather a comprehensive history of all Bitcoin transactions. In fact, the entire blockchain is full of transactions and not much else (and a bit of data that connect the blocks).
Bitcoin is a system designed to avoid having to trust account balances (maintained by third parties), and in fact allows everyone to verify and track every single fraction of a coin that ever existed to make sure no one is gaming the system. This can be done by making all transactions public and verifiable.
See, Bitcoins don’t actually move between addresses, they actually exist in virtual vaults with special cryptographic locks. Instead of sending them, you just change the locks. If Alice “owns Bitcoins”, she actually just has a cryptographic key to a vault that has BTC inside. And when Alice wants to send those Bitcoins to Bob, she just unlocks her lock and puts the Bitcoins in a vault with Bob’s lock on it. Now Bob “owns” them.
Vaults and locks are free and easy to make, so if Alice only wants to send some of the coins (and keep the rest), she can create a new vault with her lock and put the change in it. Every time someone opens a lock, the whole network needs to be able to verify it (otherwise they will consider it cheating), so a cryptographic signature is used to prove you have the key to that lock.
Since this is all done digitally, a Bitcoin transaction is simply a record of:
- Input(s): signature proving you can actually open a locked vault.
- Output(s): how many Bitcoins are placed in each new vault and with what lock.
The sum of your outputs cannot be higher than the sum of your inputs (otherwise you’re making Bitcoins out of thin air), but it can be lower. The difference in the sum of inputs and outputs equals to the miner fee. This means that you will never see any reference to miner’s fees in a transaction, rather you simply infer it: one BTC inputs – 0.9 BTC outputs = 0.1 BTC miner fee. Bitcoin wallets manage this automatically for you.
So what does a Bitcoin transaction actually look like?
“Raw” Bitcoin transactions are actually very difficult to read, which is why there is a plethora of “block explorers”, which are websites or other software used to “translate” and more easily read what’s going on in the blockchain. For this example, we will look at Blocktrail, but you can really use any of many (and trust me, there are many).
Blocktrail, like many block explorers, will show more information about the transaction than the transaction itself: things like when it was first seen, how long it took to confirm; other explorers will tell you how much money was “sent” and how much was “change”, etc. Most of this extra information is useful, but it is also mostly guessing. Only the transaction itself in the blockchain can be verified cryptographically.
The following transaction (following the convention of being named after the “hash” of the transaction itself: 61a1..0b0c) is a pretty simple and common transaction: it collects BTC from two different inputs (previous transactions) for a total of 159 bits and then sends them to two different outputs for a total of 59 bits. Note that there are 100 bits leftover, which were never used in the transaction outputs: they were leftover for miner fees.
The basics: inputs, outputs and values
These are the most important parts of the transaction page, they tell us where the money is coming from and where it’s going. Let’s say we want to confirm receiving a Bitcoin payment (let’s say 50 bits to the address 1AFc…7VeQ), so we’ll look for our address in the list of outputs, and confirm that the correct amount of coins were sent there. In this case, we see that the transaction indeed includes our payment.
The other output (which sends nine bits to 3GmY…6J4S) is probably their change address, but that’s extrapolation, and honestly not much of our business. We can follow each address by clicking on it, or follow each input/output by clicking the arrow next to it. The ‘P2SH’ label means that the address (the lock on the vault) is a script hash, which means that the address allows for the recipient to use more complex signatures (such as multisig).
The information above the inputs and outputs could be of use, such as when Blocktrail first saw the transaction (“Relay time”), as well as how long it took until it was confirmed in a block (“Time until confirmed”). Of course, it will show us in which block it was confirmed (“Block”), as well as how many confirmations it has (“Confirmations”). The “Priority” is Blocktrail’s way of calculating how good the fees are on this transaction (based on coin age and transaction size in bytes).
The real, hard information about the transaction is actually listed in the scripts on the bottom: that’s the “raw” information about each of the inputs and outputs. The output script includes the cryptographic lock and vault that you’re sending the Bitcoins to. The input script includes the signature proving that the owner of the vault can open the lock determined by the previous output (from the previous transaction).
If you’re interested in learning more in depth about Bitcoin transactions, I highly recommend browsing through the Transactions chapter in Mastering Bitcoin by Andreas Antonopoulos.
I hope someone here can help me.
My story is that, in 2014 I bought btc from [email protected]. I didn’t really know much at the time, i just needed it to buy something online. I still have my email history of our communications. He gave me a account number to deposit the money and order ID, i went and deposited cash in Wells Fargo bank and he sent me the transaction link, which shows how much BTC and other info. I never really used the BTC and left it there until now. i dont remember doing anything with the link he sent me which i still have
The problem is that i dont really remember about a Key or anything else. I am trying to access that money and i dont know how. can someone help me? how does it work when you buy BTC like i did. did they send me the key in another email? or did they rip me off.? please help.
I see that CashIntoCoins has rebranded as ExpressCoin. Their new site is expresscoin.com. I suggest you visit that site and contact their support there (via [email protected]). If you have the email and bank records and can prove your identity, they may be able to help you.
If you don’t have the private key, it won’t be possible to move the coins. Your only hope in this situation is that ExpressCoin recorded the private key and will resend it to you. Once you have the key, be very cautious in who you share it with. If someone claims to be able to recover your BTC if you share the private key, be very careful.
Thank You Steve,
I tried to contact the new site, the only way is thru email. they didn’t reply to few emails i sent, they dont seem to be responding at all. it is about 5 BTC.
Hello blogger, I lossed access to my blockchain wallet. How can I calculate my private key from my input and output addresses
Bad news, it’s not possible to work backward from a Bitcoin address to the private key which controls it. If that were possible, then anyone could work out Bitcoin private keys and steal all the funds. Are you sure you didn’t record the private key somewhere? If it’s in a file you deleted, it may be possible to recover it with an “undelete” app.
Hi, Anyone can teach me how to find the transaction time of each transaction from the bitcoin raw data? I tried to find from the Bitcoin WiKi : Protocol documentation but couldn’t find it.
Appreciate if anyone can tell any hints!
Hi Minho, here you can read more why transactions are pending on the blockchain: https://99bitcoins.com/why-bitcoin-transaction-pending-bitcoin-fees/