Which of the following best explains the main reason blockchain technology was created?
Think about what problem blockchain solves related to trust and control.
Blockchain was created to allow multiple parties to share data securely and transparently without needing a trusted middleman. This prevents tampering and fraud.
What key problem in digital transactions does blockchain technology address?
Consider what happens if someone tries to spend the same digital money twice.
Blockchain prevents double spending by recording transactions in a secure, shared ledger that all participants verify, ensuring trust without intermediaries.
Consider this Python code that simulates a simple blockchain block validation. What will it print?
block = {'index': 1, 'data': 'Hello', 'previous_hash': '0'*64}
import hashlib
def hash_block(block):
block_string = f"{block['index']}{block['data']}{block['previous_hash']}"
return hashlib.sha256(block_string.encode()).hexdigest()
block_hash = hash_block(block)
if block_hash.startswith('0000'):
print('Block is valid')
else:
print('Block is invalid')Look at the hash prefix check and what the hash function returns.
The hash of the block is very unlikely to start with '0000' without special mining. So the code prints 'Block is invalid'.
What will this JavaScript code print when run?
const transactions = [{from: 'Alice', to: 'Bob', amount: 50}, {from: 'Bob', to: 'Charlie', amount: 30}];
function verifyTransaction(tx) {
return tx.amount > 0 && tx.from !== tx.to;
}
const results = transactions.map(verifyTransaction);
console.log(results);Check the conditions in verifyTransaction for each transaction.
Both transactions have positive amounts and different sender and receiver, so both return true.
Which of the following best explains why decentralization is a key feature of blockchain?
Think about how decentralization affects trust and control.
Decentralization means no single party controls the data, so participants can trust the system without trusting one authority.