anatomy of a blockchain

13
Anatomy of a Blockchain Dr. Avtar Sehra

Upload: dr-avtar-sehra

Post on 12-Jan-2017

222 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Anatomy of a blockchain

A n a t o m y o f a B l o c k c h a i nD r . A v t a r S e h r a

Page 2: Anatomy of a blockchain

A N AT O M Y O F A B LO C KC H A I N

Page 3: Anatomy of a blockchain

1. B i t c o i n2. E v o l u t i o n o f t h e I n t e r n e t3. B l o c k c h a i n4. C o m p o n e n t s o f a B l o c k5. U n s p e n t T r a n s a c t i o n s6. M i n i n g B l o c k s7. E t h e r e u m N e t w o r k8. S m a r t C o n t r a c t O v e r v i e w

Page 4: Anatomy of a blockchain

Bitcoin Created in 2009 the current market capitalization of Bitcoins in circulation is

>$10billion

• Bitcoin is a digital currency that can be directly transferred from one person to another• If you own Bitcoins the updated ledger shows how many coins you have in your account (i.e. address)• If you have Bitcoins in your account you can transfer them to another account, and the ledger is updated appropriately• What’s so different from a normal payment network?

User 1:User 2:User 3:User 4:User 5:User 6:

100020010150

Ledger

User 1:User 2:User 3:User 4:User 5:User 6:

703020010150

Ledger

User 1 transfers 30Btc to User 2

Page 5: Anatomy of a blockchain

Evolution of the Internet

The internet revolutionized P2P sharing of information over network, removing

the need for centralization and intermediation

The internet made P2P Transaction of Information possible

The Blockchain makes P2P Transaction of Value possible

A

Page 6: Anatomy of a blockchain

Blockchain

Owner A: 100Owner B: 100Owner C: 0

Hash of #2A –> B: 50B –> C: 10

Hash of #1A –> C: 10B –> C: 50

Hash of #0C –> A: 100C –> B: 100

Owner A: 90Owner B: 50Owner C: 60

Owner A: 40Owner B: 90Owner C: 70

Block 1

Block 2

Block 3

Blockchain data structure Data structure replicated across network of participants

Owner A: 0Owner B: 0Owner C: 200

0 –> C: 200Block 0

A

B

C

Key Drivers for use of Blockchain• Network of Participants: Number of stakeholders want to execute transactions between each other • Transfer of Value: Network participants want to transfer something of value securely and immutably • No Transfer Intermediary: All value transfers between network participants is executed peer to peer

Blockchain is a cryptographic linked list data structure, replicated across a network using a consensus mechanism, enabling secure value

transfer between participants

Page 7: Anatomy of a blockchain

A single block in the Blockchain is constructed using a number of key elements related to

identification information and the list of transactions being stored

Components of a Block

BLOCKBlocks are units of the Blockchain

HEADER

Version

Merkle Root

Difficulty

Previous Block Hash

Timestamp

Nonce

TRANSACTION COUNT

BLOCK CONTENT

Coinbase TX Bitcoin TX

Total Bitcoin + Coinbase TX

TransactionEach transaction is a Bitcoin payment

TECHNICAL DATA

Version

Number of Inputs

Lock Time (delay)

Number of Outputs

INPUTS

OUTPUTS

Previous TX Hash / Output Index

Private Unlock Script Script Length

Amount

Script LengthPublic Locking Script

Page 8: Anatomy of a blockchain

Mining Blocks Each full node in the network provides computing power to secure the network by receiving,

authenticating, storing and sharing transactions through the consensus mechanism

Hash of #2A –> B: 50B –> C: 10

Hash of #1A –> C: 10B –> C: 50

Hash of #0C –> A: 100C –> B: 100

0 –> C: 200

Hash Calculated:

121232

Block 1

Block 2

Block 3

Block 0

Block 4

Hash Calculated:

121232

???? ??

??

??

??

??

• Transmission: New transactions are sent to the network and stored by each node• Structuring: Nodes select transactions and form a structured Block object (using a nonce)• Hashing: Block is hashed, which means a calculation is performed to generate a single number• Check: If hash number is below Difficulty Block is distributed to network, else process is repeated (new nonce) • Recording: If the Block meets key criteria, it is accepted by other nodes and added to their Blockchain• Confirmation: As more Blocks are added to the chain previous Blocks become increasingly secure

A

Page 9: Anatomy of a blockchain

Unspent Transactions Bitcoin stores data about users' balances in a structure based on unspent transaction

outputs (UTXOs), where each output has an owner and a value

• Input: Every referenced input must be valid and not yet spent

• Signature: transaction must have signature matching owner of the input for every input

• Inputs>=Output: Total value of inputs must equal or exceed the total value of the outputs

• UTXO: A user's "balance" in the system is the total value of the set of UTXO coins for which the user has a private key

• Structure: Each UTXO is stored with: Address, TXID and Value

Page 10: Anatomy of a blockchain

Ethereum Network Ethereum is a Blockchain based network, similar to Bitcoin, but in addition to value

transactions it enables smart contract functionality

Ethereum Transaction

TECHNICAL DATA

To (Null for Contract)

Gas Price

Ether to Transfer

Start Gas

DATA

Smart Contract Code for Execution on Chain

General Text

Nonce Signature

• Transaction: An Ether payment transaction can be sent from one address to another address like in Bitcoin

• Contract: Insert code into transaction Data field, and send to null address – mined as a Contract

• Interaction: Users and contracts can interact with other contracts by sending transactions to their addresses

• System: Complex contract structures can be created that are triggered based on transactions from each other

• Compute: On-chain calculations can be performed and data stored but costs ether (measured in Gas)

• Accounts: No UTXO, state stores a list of accounts (addresses), where each account has a balance

• Balance: Transaction is valid if sender account has balance, then sending account debited and receiving credited

Page 11: Anatomy of a blockchain

Complex contracts can be constructed that enable execution of standard

transactions based on agreed trigger events

Smart Contracts for Bonds

CATASTOPHE BOND SMART CONTRACT

INVESTORISSUER

Cat Bond Principal

Premium(and Principal)

Contingent Payment

Premium

CATASTROPHE TRIGGER AGENT

Cat Trigger Event

TS1

TS2

TS3

TS4TS5

TS6

TS8

TS7

• TS1: Bond Contract Setup

• TS2: Fund Transfer by Investor

• TS3: Subscription Confirmation

• TS4: Recurrent Payment to Contract

• TS5: Recurrent Payment to Investor

• TS7: Trigger Event Confirmation

• TS6: Principal Payment to Investor

• TS8: Principal Payment to Issuer

Page 12: Anatomy of a blockchain

Transparency Cost Flexibility RiskExchange Markets

Blockchain Enabled

OTC Markets

Blockchain based CCP and depository enables transparency and settlement risk control of

exchange markets with flexibility and low cost of OTC markets

Blockchain and Finance

Page 13: Anatomy of a blockchain

• The information provided by Nivaura in this document (Response) is proprietary and confidential to Nivaura.• Without Nivaura’s prior written permission, our Response, either in whole or in part, must not be reproduced in any form or by any means or disclosed to others or used for purposes other than its evaluation by the intended party. It may not be disclosed to any third party even

for the purposes of evaluation, except as expressly authorised by Nivaura in each case.• Where we have mentioned other Clients or Partners by name we stipulate that no contact be made with any such Client or Partners without the prior approval of Nivaura in each case. • Where this Response makes reference to trademarks that may be owned by others, the use of such trademarks herein is not an assertion of ownership of such trademarks by Nivaura and is not intended to represent or imply the existence of an association between Nivaura and

the lawful owners of such trademarks.• This Response and any document to which it is attached is subject to (i) completion of each party’s internal review process and; (ii) subject to contract, where applicable.• Whilst care and attention has been exercised in the preparation of this Response, Nivaura do not accept responsibility for any inaccuracy or error or any action taken in reliance on the information. This Response remains subject to contract and all warranties whether express or

implied by statute, law or otherwise are hereby disclaimed and excluded to the extent permitted at law.• Any pricing or valuation information provided in this document is provided on a budgetary basis for evaluation purposes only. Any final agreement by the parties on pricing or valuations shall be agreed via an appropriate contract (to be agreed).

© Nivaura 2016

D r . A v t a r S e h r a

a v t a r @ n i v a u r a . c o m