payment protocols - block chain & beyond
TRANSCRIPT
QTMA 2015 - 2016 1
Alex Kiriakou
Block Chain & Beyond
September 2015
QTMA 2015 - 2016 2
Definitions1
Today’s Payment Protocols2
Cryptographic Solutions4
Problem With Online Currencies3
Block Chain & Bitcoin5
6 Other Consensus Protocols: Ripple
7 Comparison of Block Chain to Other Protocols
QTMA 2015 - 2016 3
Term Definition
AddressA ledger address is similar to a physical address or an email. It is the only information
you need to provide for someone to pay you with
Block
A record in the block chain that contains and confirms many waiting transactions. For
Bitcoin this is roughly every 10 minutes on average, but for other consensus based
protocols this could be seconds
Block Chain
The block chain is a public record of Bitcoin transactions in chronological order. The
block chain is shared between all Bitcoin users. It is used to verify the permanence of
Bitcoin transactions and to prevent double spending
Confirmation/ConsensusA transaction that has been processed by the network and is highly unlikely to be
reversed. Transactions receive confirmation when they are included in a block/ledger
Cryptography Mathematical proofs that provide high levels of security
Double SpendIf a malicious user tries to spend their bitcoins to two different recipients at the same
time, this is double spending
Hash Tree (Merkle Tree)
A tree in which every non-leaf node is labelled with the hash of the labels of its children
node. Hash trees are useful because they allow efficient and secure verifications of the
contents of large data structures. In Bitcoin, the leaves are transactions from one block
Ledger
Record of the amount of currency in each user’s account and represents the “ground
truth” of the network. The ledger is repeatedly updated with transactions that
successfully pass through the consensus process
Last-Closed LedgerMost recent ledger that has been confirmed by the consensus process and thus
represents the current state of the network
QTMA 2015 - 2016 4
Term Definition
Mining
The process of making computer hardware do mathematical calculations for the
network to confirm transactions and increase security. As a reward for their services,
miners collect fees for the transactions they confirm along with new currency
Node Any computer that connects to the network
Open Ledger
Current operating status of transactions initiated by end users (nodes) of a given server,
which are then applied to the ledger of that server. Transactions are not considered final
until they have passed consensus and then becomes the last-closed ledger
P2P
Peer-to-peer refers to the systems that work like an organized collective by allowing
each individual to interact directly with the others. In the case of Bitcoin, the network is
built in such a way that that each user is broadcasting the transactions of other users
without any bank or third party required
Private Key
A secret piece of data that proves your right to spend bitcoins from a specific wallet
though a cryptographic signature. Private keys must never be revealed as they allow
the owner of the account to spend bitcoins from their respective account
ServerA server is an entity running the protocol software, which participates in the consensus
pool
SignatureA cryptographic signature is a mathematical mechanism that allows someone to prove
ownership, such as a Bitcoin wallet and its private keys
Wallet
A digital wallet is loosely the equivalent of a physical wallet on a cryptocurrency’s
network. A Bitcoin wallet contains your private key(s) which allow you to spend Bitcoins
allocated to it in the block chain
SWIFT Payment Protocol
Today’s Protocol
6QTMA 2015 - 2016
2-5 Days of Settlement Time For FX Transaction
QTMA 2015 - 2016 7
SWIFTA Financial “Message”
ChallengesCurrent Use
Society for Worldwide Interbank Financial
Telecommunications (SWIFT) provides a network for
financial institutions worldwide to send and receive
information about financial transactions, went live in 1977
SWIFT does not facilitate funds transfers
It sends payment orders that must be settled by
corresponding accounts the institutions have with
each other
In December 2014 announced that they would be looking
into a real-time settlement solution using new P2P
technologies
Remittance fees average around 7% which is very costly to
send money abroad
These fees and restrictive practices are costing
people in the developing world up to $16 billion/year
Transfers can take up to a week or more to be deposited
into the beneficiary’s account
Regulatory initiatives have become a burden when trying to
upgrade the current infrastructure to process transactions
faster
Regulatory reforms have been a big contributor to the
increases in costs
Links 10,800 financial institutions in over 200 countries
Averages over 23 million messages per day
Majority of messages are for either payments or
securities
Many people in the developing world depend on money
transfers to maintain living standards
Philippines received $25 billion in remittances last
year, which was more than the country’s electronics
industry ($22 billion)
In Vietnam, cash transfers were valued at $11 billion,
which almost equaled country’s petroleum exports
($12 billion)
QTMA 2015 - 2016 8
QTMA 2015 - 2016 9
No intrinsic way of determining from two transactions which came earlier, which has plagued currencies before Bitcoin
Risk that original holder could make copy of the digital token and send it to another party while retaining the original
Buyer
Buyer
SellerOwns 1 CoinCopy
Original
QTMA 2015 - 2016 10
Collision-ResistantThree Main Properties
Puzzle-FriendlinessHiding
1. Its input can be a string of any size
2. It produces a fixed size output (i.e. 256-bit)
3. It is efficiently computable. For any given
string, you can figure out what the output
of the has function is in a reasonable
amount of time
A hash function, H(), is said to be collision
resistant if it is infeasible to find two values, x
and y, such that x ≠ y, yet H(x) = H(y)
H(x) = H(y)
y
x Don’t Want
Because the number of inputs exceeds the number of
outputs, we are guaranteed that there will be one output
which has more than one input (collisions)
A hash function is hiding if: when a value r is chosen from a
probability distribution that given x, it is difficult to find H (r |
x)
If every possible 256-bit output value y, if target k, is
chosen from a distribution, then it is infeasible to find x such
that H (k | x) = y in a time significantly less than 2^256
If someone wants the target hash function to come out a
certain way (output y), if that target (k) is chosen in some
random way, it is very difficult to find another value that hits
that output y
Makes finding collisions very difficult to happen by accident
(unless you want them to happen)
Asymmetrical security is mainly used with collisions
Example of Hash Function in Block Chain
11QTMA 2015 - 2016
Only Public Key can decrypt Private Key message and vice-versa
Decrypting Private Key messages with Public Key to match unencrypted
message broadcasted on network verifies it’s authentic (manufactured collision)
Private Key allows you to spend your Bitcoins
Buyer > Seller
1 BTC
Buyer > Seller
1 BTC Encrypt
Seller Uses
Buyer Public
Key
Buyer Private
Key
Decrypt
QTMA 2015 - 2016 12
The Longest Chain With Hash Pointers
Orphan Blocks ExampleA block chain is a linked list of blocks that is built with hash
pointers H( )
Each block tells us the value of the previous block as well
as a value to tell us that the value hasn’t changed
The hash pointer that points to the previous block is
stored in the head of the list of the new block
Takes 10 minutes to verify a block
Verify blocks with mining
Orphaned blocks are blocks that are not part of the longest
chain and must be verified again (1 in every 60 blocks)
Blocks in blue have created the longest chain while
blocks in pink have become orphaned
All Linked Together
Trans TransTrans
Prev: H( ) Prev: H( ) Prev: H( )Block #1 Block #2 Block #3
H( )
QTMA 2015 - 2016 13
Simplified Consensus Algorithm
The Block Reward
Mining Creates Proof of Work
Incentives in Mining
Cryptocurrencies require that users contributing to the
verification process must demonstrate a cryptographic “proof
of work” to show that they have paid a cost in computation
time before their proposals are accepted
If hash value produced is below threshold, the proof of work
is complete
Miners keep trying different nonce values via trial
and error until this is reached
Miner that finds the nonce value can then suggest the next
block in the block chain
1. New transactions are broadcasted to all nodes
2. Each node collects new transactions into a block
3. In each round a random (one that produces proper
hash value) gets to broadcast its block
4. Other nodes accept the block only if all transactions in
it are valid (unspent, valid signatures)
5. Nodes express their acceptance of the block by
including its hash in the next block they create
Year BTC Reward
2009-2013 50 BTC
2013-2017 25 BTC
2017-2021 12.5 BTC
2021-2025 6.25 BTC
2025-2029 3.125 BTC
2029-2033 1.5625 BTC
Creates honest miners by rewarding miners that created
the blocks in the longest consensus chain
Miner to create latest block is rewarded “newly minted”
bitcoins in a transaction to their account
Value of reward halves every 4 years
However mining is zero-sum
If miner solves block N and doesn’t tell anyone while
working on block N+1 then other miners who are still
working on N lose resources
If miner joins pool but doesn’t share proof of work,
pool shares revenue with attacker but doesn’t receive
anything in return
QTMA 2015 - 2016 14
Correct Tree Inconsistent Tree
H(d8ca)
H(2f9c)
H(d063)H(48a5)
H(e74b) H(a8b5)
H(12c5)
Buyer > Seller
1 BTC
H(d187)
H(d8ca)
H(2f9c)
H(d063)H(48a5)
H(f96q) H(a8b5)
H(4a2f)
Buyer > Buyer
1 BTC
H(d187)
Change in
Merkle Tree
QTMA 2015 - 2016 15
Block Size
Price Volatility – 5% BTC vs 1% FiatThe Miner’s Dilemma
Plans of block size increase are a subject of heated debate in the Bitcoin community
The subject has gained attention since the beginning of 2015, when the size of blocks started to approach the current hard
limit of 1 megabyte
Current block size limits only allow for 7 transactions per second
Visa and MasterCard perform hundreds of thousands of transactions per second
If the blocks reach their hard limit transaction processing could take much longer than previously and provide disincentives
for users to transact in Bitcoins as well as increases the chance of an orphan block/chance to double spend
If Bitcoin wants to position itself as a replacement for current payment services, it must be able to handle an increased
amount of transactions
Other benefits are that it will keep transaction fees small and more transactions for systems built on top of Bitcoin
Some other problems for larger block sizes are that it will increase hardware requirements to min
Each minor seldom generates a block
Miners would have to wait for an extended period to create
a block and earn actual Bitcoins
Therefore miners form mining pools where all
members mine and share their revenue when one of
them creates a block
Mining is only profitable using dedicated hardware in
cutting edge mining rigs; otherwise costs > revenue
Expected revenue of pool vs. mining solo for a miner is the
same except that a pool allows for stable income
16QTMA 2015 - 2016
QTMA 2015 - 2016 17
Ripple XRP Creates Liquidity A New Consensus Protocol: Ripple
Ripple FX Transaction
Ripple is an open-standard Internet Protocol (IP)
technology for banks to clear and settle transactions in real-
time via a distributed network
Banks can use Ripple to make faster payments in more
currencies to more markets – al with lower risks and costs
than is possible today
Computers on network reach a global consensus
and close ledger within seconds
Ripple does not look to replace existing networks but
enables them to become faster and more interconnected
Real-Time Settlement For FX Transaction
QTMA 2015 - 2016 18
Block ChainRipple
Does Not Require a Transaction Fee
You can generally get a Bitcoin transaction for
free if you are patient enough. However, Ripple
transactions always have an XRP cost, which is
destroyed in Ripple network and not paid to
anyone
Does Not Need Reliable Gateways
Ripple uses gateways, companies that make
settlement agreements with users (hold IOUs)
If you hold currency in Ripple, you have
trusted someone to hold your money
Block Chain requires no trust as it is
decentralized and not distributed
Bitcoins Not Classified As Liabilities
Currencies in Ripple represented as debts
(IOUs), much like how traditional banking works
today
Bitcoins on other hand are in possession of
owner
1
3
2
Speed of Consensus
Transactions on Ripple are confirmed in real-
time, usually around 15 seconds. Block Chain
transactions could take up to an hour to receive
probable confirmation as each block of
transactions takes 10 minutes on average
Ability to Look For Cheapest Path to Transact
Scalability
Currently Block Chain tied to only 7 transactions
per second and downloading entire block chain is
now ~41,000MB in size as of today to check all
transactions
Ripple has scalability features such as not
needing to keep transaction history
1
3
2