CodeChain Programmable multi-asset blockchain

21
CodeChain Programmable multi-asset blockchain June 7, 2018

Transcript of CodeChain Programmable multi-asset blockchain

Page 1: CodeChain Programmable multi-asset blockchain

CodeChainProgrammable multi-asset blockchain

June 7, 2018

Page 2: CodeChain Programmable multi-asset blockchain

Kodebox is a blockchain technology company on a mission to create and enable a smarter asset management system

About US

Page 3: CodeChain Programmable multi-asset blockchain

CodeChain is a programmable open source blockchain technology optimal for developing and customizing multi-asset management systems

CodeChain

Page 4: CodeChain Programmable multi-asset blockchain

Key Features

● Built-in multi-asset management solutionIssue, transfer and manage currencies,

tokens and/or digital items on a blockchain

network. No need for smart contracts

● Pluggable consensus modelChoose the consensus model optimal for

your business: PoW, Tendermint, Hot-stuff,

and PoA

● Multiple types of transactionsMake use of CodeChain’s support for

programmable transactions: asset

evolution, fusion, random item generation,

escrow, payment channels and atomic

swap

● Scalability - ShardingAchieve higher transaction speed through

horizontal scaling

Page 5: CodeChain Programmable multi-asset blockchain

Pluggable Consensus

Page 6: CodeChain Programmable multi-asset blockchain

CodeChain Virtual Machine

Custom Transaction Custom Transaction Custom Transaction

PluggableConsensus

PoA Tendermint HotStuff

PluggableP2P Networking

Discovery Consensus Sync

Architecture

Page 7: CodeChain Programmable multi-asset blockchain

Consensus

● Pluggable consensus architecture○ PoW (Proof of Work)

○ PoA (Proof of Authority)

○ Tendermint

○ Hot-Stuff

● Separation between beacons and replicas○ Beacon: a mechanism for triggering proposals

○ e.g., PoW (Beacon) + Wendy (Replicas)

Page 8: CodeChain Programmable multi-asset blockchain

Hybrid schemes were developed that combine PoW chains with BFT to

● increase throughput

● decrease latency to finality

● promote fairness

CodeChain: Consensus Laboratory

Use a permissionless chain to determine a

participant/proposer rotation

● Byzcoin, Bitcoin-NG and Hybrid Consensus

A chainless BFT protocol in the

permissionless settings that uses PoW to

generate propositions and rotate members

● Solida/Solidus

Uses a permissionless chain for recovery from

failures

● Thunderella

Uses a BFT engine as a finalizing authority

over a permissionless chain

● Casper the Friendly Finality Gadget

Page 9: CodeChain Programmable multi-asset blockchain

Programmable Transaction

Page 10: CodeChain Programmable multi-asset blockchain

Transaction Format

10 Gold

5Jordan

5Jordan

4Adena

10 Jordan

- lock_script_hash: H256,- parameters: Vec<Bytes>,- asset_type: H256,- amount: u64

- prev_out: AssetOutPoint,- lock_script: Bytes,- unlock_script: Bytes,

AssetTransferInput AssetTransferOutput

Page 11: CodeChain Programmable multi-asset blockchain

CodeChain VM

● Guaranteed termination● Bitcoin-like script language for locking and unlocking assets● P2SH by default

e.g., Pay To Pub Key

● Unlock Script: Push <signature>● Lock Script($pub_key): Push $pub_key ChkSig

Page 12: CodeChain Programmable multi-asset blockchain

User doesn’t pay the fee

Page 13: CodeChain Programmable multi-asset blockchain

Gateway

CodeChain Network

Gateway

Asset owner

Asset owner

Asset owner

AssetTransfer

Node

Node

Node

NodeParcel

1. Creates “Parcel”, which groups the transactions

2. Signs to parcel. Signer pays fee for the parcel

3. Sends signed parcel to CodeChain network

Page 14: CodeChain Programmable multi-asset blockchain

Parcel Format

● Fee determines priority● Minimum fee exists● nonce prevents replay attack● Sender is derived from the signature

pub struct Parcel { pub nonce: U256, pub fee: U256, pub transactions : Vec<Transaction>, pub network_id: u64,}

pub struct UnverifiedParcel { unsigned: Parcel, v: u8, r: U256, s: U256, hash: H256,}

Page 15: CodeChain Programmable multi-asset blockchain

Horizontal Scalability through Sharding

Page 16: CodeChain Programmable multi-asset blockchain

● Provide horizontal scalability○ Different shards can execute transactions

in parallel

● World is a logical division○ Shard has multiple worlds

○ Worlds in the same shard share the state

trie

● Top-level trie contains the root of shard-tries and metadata

Top-level Root Metadata

Shard1

Shard NShard2 Trie Root ……

World1

World2 World3

Sharding

Page 17: CodeChain Programmable multi-asset blockchain

Shard Participant

● Gateway

○ Creates parcel○ Collect signatures for Parcel from Validators

● Validator

○ Validates Parcel○ Run transactions for specific shards○ Computes shared-trie state

● Beacon

○ Generates block and propagation○ Cares only about top-level trie

Page 18: CodeChain Programmable multi-asset blockchain

Fast Sync

Page 19: CodeChain Programmable multi-asset blockchain

Snapshot sync

● Mix of Fast sync and Warp sync○ Download all headers & invoices from

genesis

○ Fetch entire subtree instead of fetching

each nodes separately

● Grandchild of root becomes snapshot chunk

○ At most 257(1 + 28) downloads for

complete recovery

● Dynamic validator support

R

snapshotchunk

Manifest

Page 20: CodeChain Programmable multi-asset blockchain

Homehttp://codechain.io/

Bloghttps://medium.com/codechain/

Facebook Pagehttps://www.facebook.com/codechain/

Twitterhttps://twitter.com/codechain_io

Thank You

Page 21: CodeChain Programmable multi-asset blockchain

GoCryptobot

World's first blockchain mobile game for both iOS and android

● Android: https://play.google.com/store/apps/details?id=com.kodebox.gocryptobot

● iOS: https://itunes.apple.com/app/id1357491624