10.02.2016 Views

Bitcoin and Cryptocurrency Technologies

1Qqc4BN

1Qqc4BN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 3: Mechanics of <strong>Bitcoin</strong><br />

This chapter is about the mechanics of <strong>Bitcoin</strong>. Whereas in the first two chapters, we’ve talked at a<br />

relatively high level, now we’re going to delve into detail. We’ll look at real data structures, real<br />

scripts, <strong>and</strong> try to learn the details <strong>and</strong> language of <strong>Bitcoin</strong> in a precise way to set up everything that<br />

we want to talk about in the rest of this book. This chapter will be challenging because a lot of details<br />

will be flying at you. You’ll learn the specifics <strong>and</strong> the quirks that make <strong>Bitcoin</strong> what it is.<br />

To recap where we left off last time, the <strong>Bitcoin</strong> consensus mechanism gives us an append-only<br />

ledger, a data structure that we can only write to. Once data is written to it, it’s there forever. There’s<br />

a decentralized protocol for establishing consensus about the value of that ledger, <strong>and</strong> there are<br />

miners who perform that protocol <strong>and</strong> validate transactions. Together they make sure that<br />

transactions are well formed, that they aren’t already spent, <strong>and</strong> that the ledger <strong>and</strong> network can<br />

function as a currency. At the same time, we assumed that a currency existed to motivate these<br />

miners. In this chapter we’ll look at the details of how we actually build that currency, to motivate the<br />

miners that make this whole process happen.<br />

3.1 <strong>Bitcoin</strong> transactions<br />

Let’s start with transactions, <strong>Bitcoin</strong>’s fundamental building block. We’re going to use a simplified<br />

model of a ledger for the moment. Instead of blocks, let’s suppose individual transactions are added<br />

to the ledger one at a time.<br />

Figure 3.1​an account-based ledger<br />

How can we build a currency on top of such a ledger? The first model you might think of, which is<br />

actually the mental model many people have for how <strong>Bitcoin</strong> works, is that you have an<br />

account-based system. You can add some transactions that create new coins <strong>and</strong> credit them to<br />

somebody. And then later you can transfer them. A transaction would say something like “we’re<br />

moving 17 coins from Alice to Bob”, <strong>and</strong> it will be signed by Alice. That’s all the information about the<br />

75

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!