From 21235163a90abaa3a6f6b75d40cdfa8a62d1aaed Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Sun, 22 Dec 2013 16:04:05 -0600 Subject: [PATCH] ch2 --- ch02.asciidoc | 25 +++++++++++++++++++++---- dump.asciidoc | 14 ++++++++++++++ images/payment-request-qr.gif | Bin 0 -> 2390 bytes 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 images/payment-request-qr.gif diff --git a/ch02.asciidoc b/ch02.asciidoc index e7498370..ef246f0c 100644 --- a/ch02.asciidoc +++ b/ch02.asciidoc @@ -3,11 +3,11 @@ === Transactions, Blocks, Mining and the Blockchain -Bitcoin is a system based on de-centralized trust, which means that there is no central trusted authority, but instead trust is achieved as an emergent property from the interactions of different participants in the bitcoin system. In this chapter we will examine bitcoin from a high-level by tracking a single transaction through the bitcoin system and watch as it becomes "trusted" and accepted by the bitcoin mechanism of distributed consensus. +The bitcoin system, unlike traditional banking and payment systems, is based on de-centralized trust. Instead of a central trusted authority, in bitcoin, trust is achieved as an emergent property from the interactions of different participants in the bitcoin system. In this chapter we will examine bitcoin from a high-level by tracking a single transaction through the bitcoin system and watch as it becomes "trusted" and accepted by the bitcoin mechanism of distributed consensus and is finally recorded on the blockchain, the distributed ledger of all transactions. ==== Bitcoin Overview -At a high level, the bitcoin system consists of users with wallets containing keys, transactions which are propagated across the network and miners who produce (through competitive computation) the consensus blockchain, the authoritative ledger of all transactions. +In the overview diagram below, we see that the bitcoin system consists of users with wallets containing keys, transactions which are propagated across the network and miners who produce (through competitive computation) the consensus blockchain, the authoritative ledger of all transactions. In this chapter, we will trace a single transaction as it travels across the network and examine the interactions between each part of the bitcoin system, at a high level. Subsequent chapters will delve deeper into the technology behind wallets, mining and merchant systems. [[blockchain-mnemonic]] .Bitcoin Overview @@ -15,7 +15,7 @@ image::images/Bitcoin Overview.png["Bitcoin Overview"] ==== A simple transaction -Alice, who we introduced in the previous chapter, is a new user who has just acquired her first bitcoin. Now she will make her first retail transaction, buying a cup of coffee at Bob's coffee shop in Palo Alto, California. Bob's coffee shop recently started accepting bitcoin payments, as advertised by a sign declaring _"Bitcoin Accepted Here"_ in the window. At the counter, the prices are listed in the local currency (US dollars) but at the register, customers have the option of paying in either dollars or bitcoin. Alice places her order for a cup of coffee and Bob enters the transaction on his point-of-sale system that has been adapted to convert each price to bitcoins at the prevailing market rate. The register displays the prices in both currencies, as well as showing a QR code containing a _payment request_ for this transaction: +Alice, who we introduced in the previous chapter, is a new user who has just acquired her first bitcoin. In <>, Alice met with her frined Joe to exchange some cash for bitcoin. The transaction created by Joe funded Alice's wallet with 0.10 BTC. Now Alice will make her first retail transaction, buying a cup of coffee at Bob's coffee shop in Palo Alto, California. Bob's coffee shop recently started accepting bitcoin payments, by adding a bitcoin option to his point-of-sale system (see <> for information on using bitcoin for merchants/retail). The prices at Bob's Cafe are listed in the local currency (US dollars) but at the register, customers have the option of paying in either dollars or bitcoin. Alice places her order for a cup of coffee and Bob enters the transaction at the register. The point-of-sale system will convert the total price from US dollars to bitcoins at the prevailing market rate and displays the prices in both currencies, as well as showing a QR code containing a _payment request_ for this transaction: ---- Total: @@ -23,9 +23,26 @@ $1.50 USD 0.015 BTC ---- +[[payment-request-QR]] +.Payment Request QR Code - encodes a payment request URL as defined in BIP0021 +image::images/payment-request-qr.gif["payment-request"] + +[[payment-request-URL]] +.The payment request QR code above encodes the following URL, defined in BIP0021 +---- +bitcoin:1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA?amount=0.015&label=Bob%27s%20Cafe&message=Purchase%20at%20Bob%27s%20Cafe + +Components of the URL +A bitcoin address: 1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA +The payment amount: amount=0.015 +A label for the recipient address: label=Bob%27s%20Cafe +A description for the payement: message=Purchase%20at%20Bob%27s%20Cafe +---- + + [TIP] ==== -Unlike a QR code that simply contains a destination bitcoin address, a "payment request" is a QR encoded URL that contains a destination address, a payment amount and a generic description such as "Bob's Cafe". This allows a bitcoin wallet application to pre-fill the information to send the payment while showing a human-readable description to the user. See <> +Unlike a QR code that simply contains a destination bitcoin address, a "payment request" is a QR encoded URL that contains a destination address, a payment amount and a generic description such as "Bob's Cafe". This allows a bitcoin wallet application to pre-fill the information to send the payment while showing a human-readable description to the user. See <>, for more details. You can scan the QR code above with a bitcoin wallet application to see what Alice would see. ==== Bob says _"That's one-dollar-fifty, or fifteen milibits"_. diff --git a/dump.asciidoc b/dump.asciidoc index b4a1a02d..c1b7f2de 100644 --- a/dump.asciidoc +++ b/dump.asciidoc @@ -1,6 +1,20 @@ Dump of material that needs to be placed later +[[payment-request-URL]] +.The payment request QR code above encodes the following URL, defined in BIP0021 +---- +bitcoin:1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA?amount=0.015&label=Bob%27s%20Cafe&message=Purchase%20at%20Bob%27s%20Cafe + +Components of the URL +A bitcoin address: 1GdK9UzpHBzqzX2A9JFP3Di4weBwqgmoQA +The payment amount: amount=0.015 +A label for the recipient address: label=Bob%27s%20Cafe +A description for the payement: message=Purchase%20at%20Bob%27s%20Cafe +---- + + + * External Risks All world currencies today are controlled by sovereign nation states. This control has significant political and economic benefits and is, of course, zealously protected. As a result, attempts to create competing and independent digital currencies, have quickly come under legal, or sometimes extra-legal, attack. Without a central organization, clearinghouse or controlling authority, bitcoin is not easy to attack. It is resilient to interference because control of the network and security of the currency is distributed as much as possible. diff --git a/images/payment-request-qr.gif b/images/payment-request-qr.gif new file mode 100644 index 0000000000000000000000000000000000000000..093e069f968507f070ce4b9bed0962a529875144 GIT binary patch literal 2390 zcmV-c390r+Nk%w1VaNc;0Du4h00030|Nkri0002U0LTCU0{@JUsmtvTqnxzbi?iOm z`wxcVNS5Y_rs~SJ?hD8AOxN~}=lag~{tpZahs2`sh)gP%%%<}RjY_9Hfc1*aYPSFg z7lCDb58N#HDn?JnhO*mTdds!m?b({9ljZmBBD`j|H%AypSopve0H~li*O%uf;duB+ zQfcWxiT5Yi#y2RLz!R{ z9xaYvK!1JC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