Skip to Content
Understanding Bitcoin: Cryptography, Engineering and Economics
book

Understanding Bitcoin: Cryptography, Engineering and Economics

by Pedro Franco
November 2014
Intermediate to advanced
288 pages
9h 44m
English
Wiley
Content preview from Understanding Bitcoin: Cryptography, Engineering and Economics

CHAPTER 6Transactions

Bitcoins do not reside in user’s computers. They are entries into a distributed database called the blockchain, which will be explored in Chapter 7. Unlike centralized digital currencies, Bitcoin’s blockchain does not store accounts and balances. The blockchain stores transactions.

Transactions are composed of a list of transaction inputs (TxIn) and a list of transaction outputs (TxOut). Each transaction output (TxOut) holds two pieces of data: an amount and the recipient address1. The address is derived from the public key, as explained in section 5.6. Thus only the owner of the private key can unlock the funds stored in the TxOut. To unlock the funds, the owner of the private key must sign a transaction sending the funds to a new Bitcoin address.

A transaction input (TxIn) holds a reference to a previous transaction output, and a signature that proves that the funds in the previous TxOut it references can be spent2. This signature must be done with the private key associated with the public key in the Bitcoin address. If the signature does not match, the transaction is deemed invalid and dropped by the network.

A transaction groups several TxIns and TxOuts (at least one of each). The purpose of a transaction is to distribute the funds from the inputs to the outputs. Inputs in a transaction reference outputs in previous transactions. These outputs must not have been spent, otherwise the transaction is invalid.

For the transaction to be valid, the sum ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Bitcoin for the Befuddled

Bitcoin for the Befuddled

Conrad Barski, Chris Wilmer
Learn Bitcoin and Blockchain

Learn Bitcoin and Blockchain

Kirankalyan Kulkarni
Understanding Cryptocurrencies

Understanding Cryptocurrencies

Ariel Santos-Alborna

Publisher Resources

ISBN: 9781119019145Purchase book