0
0
Blockchain / Solidityprogramming~10 mins

Consensus mechanisms overview in Blockchain / Solidity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the consensus mechanism used in Proof of Work.

Blockchain / Solidity
consensus = "[1]"
Drag options to blanks, or click blank then click option'
AByzantine Fault Tolerance
BProof of Stake
CDelegated Proof
DProof of Work
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing Proof of Work with Proof of Stake
Using Delegated Proof as the main consensus
2fill in blank
medium

Complete the code to check if the consensus mechanism is energy efficient.

Blockchain / Solidity
if consensus == "[1]":
    print("Energy efficient")
else:
    print("Not energy efficient")
Drag options to blanks, or click blank then click option'
AProof of Stake
BProof of Work
CProof of Authority
DProof of Capacity
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Proof of Work as energy efficient
Confusing Proof of Authority with energy efficiency
3fill in blank
hard

Fix the error in the code to correctly identify the consensus mechanism that uses voting among nodes.

Blockchain / Solidity
if consensus == "[1]":
    print("Uses voting among nodes")
Drag options to blanks, or click blank then click option'
AProof of Work
BByzantine Fault Tolerance
CProof of Stake
DProof of Capacity
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing it with Proof of Stake
Choosing Proof of Work which is puzzle-based
4fill in blank
hard

Fill both blanks to create a dictionary mapping consensus mechanisms to their main characteristic.

Blockchain / Solidity
consensus_info = {
    "Proof of Work": "[1]",
    "Proof of Stake": "[2]"
}
Drag options to blanks, or click blank then click option'
AHigh energy consumption
BLow energy consumption
CFast finality
DDecentralized voting
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up energy consumption characteristics
Using voting or finality terms incorrectly
5fill in blank
hard

Fill both blanks to create a dictionary comprehension filtering consensus mechanisms with energy consumption less than 100.

Blockchain / Solidity
energy_use = {
    "PoW": 1000,
    "PoS": 10,
    "BFT": 50
}
low_energy = {k: v for k, v in energy_use.items() if v {BLANK_2}} {{BLANK_2}}
Drag options to blanks, or click blank then click option'
A:
B<
C100
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '<' in the condition
Forgetting the colon ':' in the comprehension