2. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 2
OutlineOutline
· DefinitionsDefinitions
· Overview of Some OptionsOverview of Some Options
- Governance, permissions, ledger structure, block config
· Consensus MechanismsConsensus Mechanisms
- Proof of Work and other mechanisms
- ASIC-resistance
- Nonoutsourceable puzzles
· Auxiliary BlockchainsAuxiliary Blockchains
- Sidechains, and sharding
3. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 3
Definitions (1)Definitions (1)
Fundamental Properties: immutability, non-repudiation, integrity, transparency,
and equal rights
[ArchBook]
4. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 4
Definitions (2)Definitions (2)
[ArchBook]
5. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 5
Definitions (3)Definitions (3)
[ArchBook]
6. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 6
Definitions (4)Definitions (4)
[ArchBook]
7. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 7
GovernanceGovernance
· Public blockchain (Public blockchain (میمعمومیمعمو))
· Consortium/community blockchain (Consortium/community blockchain (مجمنینمامجمنینما))
- Used across multiple organizations
- Controlled by pre-authorized nodes
· Private blockchain (Private blockchain (موصیصخموصیصخ))
- Governed and hosted by a single organization (possibly multiple
divisions)
- Cost-effective, high performance, and flexible
[ArchBook]
8. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 8
PermissionsPermissions
· Permission-less public blockchainsPermission-less public blockchains
· Permissioned miners (write) and permission-less normalPermissioned miners (write) and permission-less normal
nodes (read)nodes (read)
· Permissions for fine-grained operations on the tx level (e.g.Permissions for fine-grained operations on the tx level (e.g.
creating assets)creating assets)
[ArchBook]
9. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 9
Ledger StructureLedger Structure
· Global list of blocksGlobal list of blocks
- e.g in Bitcoin, Ethereum
· Global directed acyclic graph (DAG)Global directed acyclic graph (DAG)
- e.g. in Hashgraph (blocks), IOTA (tx’s)
· Restricted shared ledgersRestricted shared ledgers
- Many small ledgers shared only between authorized parties of
interest.
- e.g. in Corda, Hyperledger Fabric
[ArchBook]
10. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 10
Block ConfigurationBlock Configuration
· Block sizeBlock size
- Control the number/complexity of transactions
- More tx’s → more tx processing and communication overhead
+ increased risk of empty blocks!
· Block generation frequencyBlock generation frequency
- Shorter inter-block time → more forks → longer confirmation
time!
[ArchBook]
11. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 11
Blockchain PlatformsBlockchain Platforms
· Hyperledger by The Linux FoundationHyperledger by The Linux Foundation
- An open source collaborative effort created to advance cross-industry
blockchain technologies.
- It is a global collaboration among 185 members, hosted by The Linux
Foundation, including leaders in finance, banking, IoT, supply chains,
manufacturing and Technology.
- 13 ongoing projects including Fabric, Sawtooth, and Iroha blockchain
platforms.
· Corda (DLT; not blockchain) by R3Corda (DLT; not blockchain) by R3
· Tendermint (Open source) by All In Bits IncTendermint (Open source) by All In Bits Inc
· Blockchain on the cloud (Amazon AWS, Microsoft Azure, etc.)Blockchain on the cloud (Amazon AWS, Microsoft Azure, etc.)
- Corda, Hyperledger Fabric, Ethereum etc on the cloud.
12. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 12
Consensus MechanismsConsensus Mechanisms
13. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 13
Consensus ProtocolConsensus Protocol
· Distributed consensus protocolDistributed consensus protocol
- There are n nodes that each have an input value.
- Some of these nodes are faulty or malicious.
- It must terminate with all honest nodes in agreement on the value.
- The value must have been generated by an honest node.
· Consensus mechanism in a blockchainConsensus mechanism in a blockchain
- Miners may propose different next blocks.
- Consensus…
●
Determines the validating process of blocks,
●
Controls malicious behavior
●
Resolves conflicts
[Princeton-Book]
14. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 14
Proof of WorkProof of Work
· Bitcoin’s Proof-of-Work (PoW)Bitcoin’s Proof-of-Work (PoW)
- Nodes (miners) solve a complicated mathematical puzzle and
earn rewards.
- The first node which succeeds is the winner of the current block.
- The other nodes validate the work.
· Proof-of-Useful-Work (uPoW) [uPoW, PrimeCoin]Proof-of-Useful-Work (uPoW) [uPoW, PrimeCoin]
- PoWs whose hardness is based on a wide array of computational
problems including deciding any graph property that is statable
in first-order logic. [uPoW]
- PrimeCoin implementation: miners find long chains of prime
numbers.
15. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 15
Bitcoin Mining PuzzleBitcoin Mining Puzzle
· Fast verificationFast verification
- Every node on the network validates every puzzle solution
· Adjustable difficultyAdjustable difficulty
- The difficulty of the puzzle can be changed over time as new
contributors join
- Puzzle solutions should be found in a fairly steady rate
· Progress‐freenessProgress‐freeness
- The odds of solving the puzzle must be independent of how much work
you have already spent trying to solve it, instead the chance of winning
a puzzle solution in any unit of time should be roughly proportional to
the hash power used. → memoryless, time is exponentially distributed.
- One vote one cpu → resistant to Sybil attacks.
[Princeton-Book]
16. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 16
ASIC-Resistant PuzzlesASIC-Resistant Puzzles
· Now, Bitcoin is almost exclusively mined by very powerful optimizedNow, Bitcoin is almost exclusively mined by very powerful optimized
ASIC chips!ASIC chips!
- Mining Bitcoin on an ordinary PC (or even old ASICs) is not profitable! →
most individuals do not mine in the Bitcoin net.
· Goal: disincentivize the use of custom‐built hardware for mining.Goal: disincentivize the use of custom‐built hardware for mining.
- More realistic: a puzzle that reduces the gap between the most cost‐effective
customized hardware and what most general‐purpose computers can do.
· Solutions:Solutions:
- Memory-hard puzzles → what to do with verification cost?
- X11 → uses 11 hash algorithms, costly to implement on HW, not profitable
yet!
· Would ASIC-resistance be a good property, anyway?Would ASIC-resistance be a good property, anyway?
[Princeton-Book]
17. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 17
Nonoutsourceable PuzzlesNonoutsourceable Puzzles
· A few large pools represent most of the Bitcoin mining power.A few large pools represent most of the Bitcoin mining power.
- Most Bitcoin miners mine as part of a pool, and each pool is operated
by a central pool administrator.
- A possible threat to decentralization of Bitcoin + block discarding
attacks between pools
· Goal: Preventing the formation of mining poolsGoal: Preventing the formation of mining pools
· One solution: Require that the miner know the private key ofOne solution: Require that the miner know the private key of
the coinbase txthe coinbase tx
- E.g. “hash of the block is below a certain target” → “hash of a
signature on the block is below a certain target”
· PreventingPreventing allall pools may lead to more centralization, doesn’t it?pools may lead to more centralization, doesn’t it?
[Princeton-Book]
18. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 18
Alternative Consensus MechanismsAlternative Consensus Mechanisms
· Practical Byzantine Fault Tolerance (PBFT) [PBFT]Practical Byzantine Fault Tolerance (PBFT) [PBFT]
- A leader node broadcasts a block proposal to other (backup) nodes. The block is
added to the blockchain upon approval of at least 2/3 of nodes.
- Nodes become the leader in a round-robin fashion.
- Pros: transaction finality, higher energy efficiency, more even payout
- Cons: Sybil attack, scalability (communication, integrity checking) → suitable for
permissioned blockchains
- Used by Hyperledger (incomplete), Zilliqa (PBFT + PoW every ~100 blocks)
· Proof-of-Elapsed-Time (PoET) [PoET]Proof-of-Elapsed-Time (PoET) [PoET]
- Utilizes a “trusted execution environment” (Intel SGX)
- Each node is given a random timer object and the first timer to expire “wakes up”
that node who becomes the block leader and produces a new block.
- Can replace the round-robin selection of leader in PBFT.
- Pro: efficiency, Con: based on Intel HW.
- Implemented in Hyperledger Sawtooth
19. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 19
Alternative Consensus Mechanisms (2)Alternative Consensus Mechanisms (2)
· Proof-of-Stake (PoS) by PeercoinProof-of-Stake (PoS) by Peercoin
- In each round, the winner (miner) is chosen based on node’s stake value →
Wealthier nodes have higher chances to be chosen.
- The miner is rewarded by proposing a block which is validated by other nodes.
- Reduces the computational power needed in comparison with PoW.
- Delegated PoS (DpoS): Only a subset group of nodes (selected by
stakeholders) participate in the block production process.
· Proof-of-Importance (PoI) [NEM-PoI]Proof-of-Importance (PoI) [NEM-PoI]
- Accounts with higher importance have higher chance to attach a new block.
- Importance rating is based on graph theoretic metrics, and interactions wih the
blockchain improves importance.
· And many other proposals!And many other proposals!
20. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 20
Side Note: Execution of Smart ContractsSide Note: Execution of Smart Contracts
· Sequential executionSequential execution
- Short smart contracts, longest validation time
· Parallel executionParallel execution
- Multiple contracts execute in parallel.
- Conflicting changes must result in deterministic result
- Resolution: report the followed runtime schedule to other miners
· Non-blocking executionNon-blocking execution
- Separating execution from the process of building blocks
- Accelerate block building and validating process
· Performance analysis toolsPerformance analysis tools
- [Blockbench], [Realtime-Perf]
[RD19]
21. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 21
Auxiliary ChainsAuxiliary Chains
22. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 22
Auxiliary Chains for Improved SecurityAuxiliary Chains for Improved Security
· Merged miningMerged mining
- Reuse miners of an established blockchain network to mine on a
new network.
- E.g. Namecoin (based on Bitcoin)
· Hook into a popular blockchainHook into a popular blockchain
- Periodically add hashes of the new blockchain into blocks of a
popular blockchain
- E.g. Factom (its current hash is submitted to Bitcoin b.c.)
· Proof-of-burnProof-of-burn
- To irreversibly ‘transfer’ tokens from one blockchain to another.
- E.g. Counterparty tokens bootstrapped from Bitcoin tokens.
[ArchBook]
23. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 23
SidechainsSidechains
· Build an ecosystem based on a popular main blockchain withoutBuild an ecosystem based on a popular main blockchain without
significantly increasing the load on it.significantly increasing the load on it.
- Plus, the main chain is protected from damages to sidechains
- Tokens of one blockchain (main chain) be securely transferred and used in
another one (sidechain), and possibly move back to the original chain.
· Two typesTwo types
- One-way: interaction is only from the main chain to the sidechain (e.g.
proof-of-burn)
- Two-way: bidirectional interaction
· Some people believe sidechains are a feature of 3Some people believe sidechains are a feature of 3rdrd
generation ofgeneration of
blockchainsblockchains
- Bitcoin → 1st, Ethereum (smart contracts) → 2nd, Corda/HLFabric → 3rd
[ArchBook]
24. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 24
Example: The Lightning NetworkExample: The Lightning Network
· Lightning is a protocol for making fast payments with Bitcoin using a network ofLightning is a protocol for making fast payments with Bitcoin using a network of
channels.channels.
- Lightning allows for two parties to conduct transactions off-chain by giving each of the
parties a cross-signed commitment transaction, which describes the current state of the
channel (basically, the current balance).
- This commitment transaction is updated every time a new payment is made and is
spendable at all times.
· There are three ways a channel can end:There are three ways a channel can end:
- Mutual close: They generate a closing transaction and publish it on the blockchain
- Unilateral close: One side publishes its latest commitment transaction.
- Revoked transaction close: one of the parties deliberately tries to cheat, by publishing an
outdated commitment transaction (presumably, a prior version, which is more in its favor)
→ will not succeed.
· Lightning is designed to be trustlessLightning is designed to be trustless
- there is no risk of loss of funds in any of these three cases
25. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 25
ShardingSharding
· Concept: Divide the blockchain into pieces.Concept: Divide the blockchain into pieces.
- Nodes only hold data of some shards instead of the full chain.
· State sharding (Ethereum 2.0)State sharding (Ethereum 2.0)
- grouping subsets of nodes into shards which in turn process
transactions specific to that shard.
· Transaction sharding (Zilliqa)Transaction sharding (Zilliqa)
- The network is automatically split into “shards,” or parallel sub-
committees.
- Each of these shards will process its given micro-block
- All micro-blocks merge to create the final one.
26. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 26
Questions?Questions?
Sadegh Dorri N.Sadegh Dorri N.
dorri@modares.ac.ir
http://www.modares.ac.ir/~dorri
27. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 27
ReferencesReferences
· [ArchBook] X. Xu et al., “Varieties of Blockchains,” in Architecture for Blockchain Applications,
Springer Nature Switzerland, 2019, Chapter 3, pp. 45-59.
· [Princeton-Book] A. Narayanan, et al., Bitcoin and Cryptocurrency Technologies, Princeton
University Press, Jul. 2016, Chapter 8.
· [RD19] S. Rouhani and R. Deters, "Security, Performance, and Applications of Smart Contracts: A
Systematic Survey," in IEEE Access, vol. 7, pp. 50759-50779, 2019.
· [PoS] V. Buterin, “What Proof of Stake Is And Why It Matters,” Bitcoin Magazine, Aug. 2013,
Link: https://bitcoinmagazine.com/articles/what-proof-of-stake-is-and-why-it-matters-1377531463/
· [DPoS] BitShares Blockchain Foundation, “Delegated Proof of Stake (DPOS),” BitShares
Documentation, Aug. 2018, Link: http://docs.bitshares.org/en/master/technology/dpos.html
GitHub:https://github.com/bitshares/how.bitshares.works/blob/master/docs/technology/dpos.rst
· [NEM-PoI] NEM Technical Reference v1.2.1, Feb. 2018, Link:
https://nem.io/wp-content/themes/nem/files/NEM_techRef.pdf
· [PBFT] L. Seeley, “Introduction to Sawtooth PBFT,” Hyperledger Sawtooth Blog, Feb. 2019, Link:
https://www.hyperledger.org/blog/2019/02/13/introduction-to-sawtooth-pbft
28. Spring 2019 (1398) E-Commerce Security - Varieties of Blockchains 28
ReferencesReferences
· [PoET] Intel Corporation, “PoET 1.0 Specification,” Hyperledger Sawtooth Documentation v1.0.5,
Jul. 2017. Link: https://sawtooth.hyperledger.org/docs/core/releases/1.0/architecture/poet.html
· [uPoW] M. Ball et al., “Proofs of Useful Work,” Cryptology ePrint Archive, Report 2017/203, Feb.
2017. Link: https://eprint.iacr.org/2017/203
· [PrimeCoin] V Buterin, “Primecoin: The Cryptocurrency Whose Mining is Actually Useful,” Bitcoin
Magazine, Jul. 2013, Link:
https://bitcoinmagazine.com/articles/primecoin-the-cryptocurrency-whose-mining-is-actually-useful
-1373298534/
· B. Curran, “What is Sharding? Guide to this Ethereum Scaling Concept Explained,” Blockonomi
Web Site, Mar. 2019, Link: https://blockonomi.com/sharding/
· [Blockbench] T. T. A. Dinh, J. Wang, G. Chen, R. Liu, B. C. Ooi, K.-L. Tan, "Blockbench: A
framework for analyzing private blockchains", Proc. ACM Int. Conf. Manage. Data, pp. 1085-1100,
May 2017. Link: https://github.com/ooibc88/blockbench
· [Realtime-Perf] P. Zheng, Z. Zheng, X. Luo, X. Chen, X. Liu, "A detailed and real-time
performance monitoring framework for blockchain systems", Proc. 40th Int. Conf. Softw. Eng.
Softw. Eng. Pract., pp. 134-143, Jun. 2018.