Trail: A Blockchain Architecture for Light Nodes Ryunosuke - - PowerPoint PPT Presentation

trail a blockchain architecture for light nodes
SMART_READER_LITE
LIVE PREVIEW

Trail: A Blockchain Architecture for Light Nodes Ryunosuke - - PowerPoint PPT Presentation

Trail: A Blockchain Architecture for Light Nodes Ryunosuke Nagayama, Ryohei Banno, Kazuyuki Shudo Tokyo Institute of Technology Tokyo Tech Blockchain size continues to increase. Bitcoin : 280 GB (June 2020) [1] Ethereum: 140 GB (June


slide-1
SLIDE 1

Trail: A Blockchain Architecture for Light Nodes

Ryunosuke Nagayama, Ryohei Banno, Kazuyuki Shudo Tokyo Institute of Technology

Tokyo Tech

slide-2
SLIDE 2

Blockchain size continues to increase.

  • Bitcoin : 280 GB (June 2020)[1],Ethereum: 140 GB (June 2020)[2]

[1, figure] https://www.blockchain.com/charts/blocks-size [2] https://blockchair.com/ethereum/charts/blockchain-size 1/19

slide-3
SLIDE 3

Why is the blockchain so large?

A Transaction in Bitcoin (UTXO-based)

Validators refer to past transactions to validate whether UTXOs in input are already used as input.

Transaction input

Alice 50 BTC Bob 20 BTC

  • utput

Alice 30 BTC Bob 40 BTC

Validators need to keep all of proofs for validation such as account states and transactions.

2/19

slide-4
SLIDE 4

Contribution

Clients keep proofs of own assets. Block size is 8 KB, and it’s constant. Trail improves decentralization of a blockchain.

A block in node storage A proof in a transaction A proof in client storage

A node of Merkle tree

3/19

slide-5
SLIDE 5

Trail

TXO TXO TXO TXO TXO TXO null null

TXO tree (a virtual data structure) Client Trail node

Trail reduces data on a node by including verification proofs in transactions instead of including the proofs in the block.

Send a tx containing TXOs and Merkle proofs. 4/19

slide-6
SLIDE 6

TXO tree

  • Trail nodes and clients maintain a single TXO tree virtually.

Blocks record the state of TXO tree as root hash.

  • TXO tree is a perfect binary tree.

used used used null null

Insert a hash value of TXOs from the left. All previously approved TXOs are assigned to leaf nodes. If a leaf node has not been assigned TXO, the node stores ℎ𝑏𝑡ℎ(𝑜𝑣𝑚𝑚). 5/19

slide-7
SLIDE 7

Generating a transaction

Transaction BlockHash

Hash value of the block that Merkle proofs of this transaction are based on.

Inputs Outputs

New TXOs

Sigs

Signatures of senders

TXO

Merkle proofs

Clients keep own TXOs and update history of their Merkle proofs, and generate transactions from them.

6/19

slide-8
SLIDE 8

Validating transactions by Trail nodes

Trail nodes validate transactions using only the latest block.

Validation 1. Whether the block hash of the transaction is equal to the hash value of the latest block. 2. Whether each TXO in the Inputs of the transaction is not in another transaction to include in new block. 3. Whether the total value of Outputs is less than or equal to the total value of Inputs minus fees. I𝑜𝑞𝑣𝑢𝑡 − 𝑔𝑓𝑓𝑡 > 𝑃𝑣𝑢𝑞𝑣𝑢𝑡

7/19

slide-9
SLIDE 9

Validating transactions by Trail nodes

Validation 4. Whether the root of the TXO tree calculated from the Merkle proof in the Inputs and the hash value of TXO ℎ𝑏𝑡ℎ 𝑈𝑌𝑃 is equal to the root of the latest block.

TXO

Parent block hash Root hash (of TXO tree) RightmostIndex …

Latest block 5. Whether the Index of the TXO in the Inputs is less than

  • r equal to the RightmostIndex in the latest block.

8/19

slide-10
SLIDE 10

Generating a block by Trail node

  • Assign TXO of Outputs from the left to the leaf node to which

TXO is not assigned yet.

  • After that, hash value of nodes in transactions and parent

block are assigned to the corresponding nodes, and the Trail node calculates a new root.

I IP

RP

R O O

RO

N IP

RP

N IP

RP

IP

RP

Root

is contained in transactions. is contained in latest block. A TXO in Inputs Merkle proofs in Inputs RightmostProof RightmostHash in latest block TXOs in Outputs New rightmost leaf node Null hash

9/19

slide-11
SLIDE 11

Generating a block by Trail node

  • Assign TXO of Outputs from the left to the leaf node to which

TXO is not assigned yet.

  • After that, hash value of nodes in transactions and parent

block are assigned to the corresponding nodes, and the Trail node calculates a new root.

I IP

RP

R O O

RO

N IP

RP

N IP

RP

IP

RP

Root is contained in transactions. is contained in latest block.

Merkle proofs in Inputs RightmostProof RightmostHash in latest block TXOs in Outputs Null hash A TXO in Inputs New rightmost leaf node

10/19

slide-12
SLIDE 12

Generating a block by Trail node

  • Assign TXO of Outputs from the left to the leaf node to which

TXO is not assigned yet.

  • After that, hash value of nodes in transactions and parent

block are assigned to the corresponding nodes, and the Trail node calculates a new root.

I IP

RP

R O O

RO

N IP

RP

N IP

RP

IP

RP

Root is contained in transactions. is contained in latest block.

Merkle proofs in Inputs RightmostProof RightmostHash in latest block TXOs in Outputs Null hash A TXO in Inputs New rightmost leaf node

11/19

slide-13
SLIDE 13

Generating a block by Trail node

  • Assign TXO of Outputs from the left to the leaf node to which

TXO is not assigned yet.

  • After that, hash value of nodes in transactions and parent

block are assigned to the corresponding nodes, and the Trail node calculates a new root.

I IP

RP

R O O

RO

N IP

RP

N IP

RP

IP

RP

Root is contained in transactions. is contained in latest block.

Merkle proofs in Inputs RightmostProof TXOs in Outputs Null hash A TXO in Inputs RightmostHash in latest block New rightmost leaf node

12/19

slide-14
SLIDE 14

Generating a block by Trail node

  • Assign TXO of Outputs from the left to the leaf node to which

TXO is not assigned yet.

  • After that, hash value of nodes in transactions and parent

block are assigned to the corresponding nodes, and the Trail node calculates a new root.

I IP

RP

R O O

RO

N IP

RP

N IP

RP

IP

RP

Root is contained in transactions. is contained in latest block.

Merkle proofs in Inputs RightmostProof TXOs in Outputs Null hash A TXO in Inputs RightmostHash in latest block New rightmost leaf node

13/19

slide-15
SLIDE 15

Generating a block by Trail node

Block

Parent Hash value of parent block Root New root of TXO tree RightmostHash Hash value of rightmost leaf node RightmostIndex Index of RightmostProof Merkle proof of =

Root

RO RO RO

14/19

slide-16
SLIDE 16

Updating the client’s data

  • Clients need to update own TXOs and Merkle proofs to

generate new transactions.

If a client owns the TXO assigned to , the client receive new hash values of and which are Merkle proof of .

I IP

RP

R O O

RO

N IP

RP

N IP

RP

IP

RP

Root IP

If a client owns , the client marks the TXO used. If a client owns , the client keeps the TXO and its Merkle proof.

I O

15/19

slide-17
SLIDE 17

Data size optimization

Tx size and client storage size are large. Client should optimize these data.

Node Client Transaction

16/19

slide-18
SLIDE 18

Transaction size optimization

  • The data size of a transaction is large, if a transaction contains all

Merkle proofs of input TXOs.

  • Ex. 8288 bytes/input TXO
  • 𝑜 TXOs are approved over a period of time.
  • If index of a TXO is larger than RightmostIndex − 𝑜 ,

nodes in Merkle proof of that TXO are same as RightmostProof at the height ≥ log7 𝑜 . log7 𝑜 𝑜 Not contained in a transaction. Contained in a transaction.

17/19

slide-19
SLIDE 19

Storage optimization

  • Since the client needs to keep the TXO Merkle Proof

update history, the client's storage size may be large.

  • Client optimizes storage as follows;

Used TXO Merkle proof TXO was used Unused TXO Merkle proof TXO was approved Now

On device Archived Deleted

harchive hdelete time 18/19

slide-20
SLIDE 20

Conclusion

Trail facilitates decentralization of a blockchain.

  • Small blockchain size
  • Block size is only 8 KB.

It’s is constant regardless of number of transactions and accounts.

  • Algorithm neutral
  • Trail can be applied to any consensus algorithm

and fork choice rule.

  • Works on mobile devices.

19/19