blockchain1 Flashcards

1
Q

what is the goal of a fault tolerant distributed system

A

when failures occur, continue to operate in an acceptable way while repairs are being made

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the server behaviour with byzantine failure

A

may produce arbitrary responses at arbitrary times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

if process P no longer perceives any action from another process Q, can process P always assume that Q has halted

A

Depends on the synchrony assumption of the network

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why do we need different communication models (aka. synchrony assumption)

A
  1. different models have their own definitions of reliability.
  2. different networks have different protocols have a different complexity of making a disparate tradeoff
  3. o If the assumption is violated (in reality), then the properties guaranteed (in
    theory) by the distributed system protocols might not hold anymore, leading to unexpected or undesirable outcomes.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Partial synchrony model [DLS88]

A

– asynchronous until Global Stabilization
Time (GST), then eventually synchronous with known time bound Δ
o adversary must cause the GST event to happen after some unknown finite time
o message sent at time t must be
delivered by time Δ + max(t, GST)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why Partial Synchrony, Why not using only synchrony model, and set a conservative (large) bound Δ?

A

o Many protocols run in “rounds/epoch”, but a large Δ (e.g. 1 hour) would result in
a long timeout for each round of communication, thus degrading performance.
o An aggressively small Δ may not faithfully model the reality, and thus, protocols
whose safety relies on the realistically set bound might suffer safety violations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Achieving Fault Tolerance

A
  1. Process resilience (protection against process failure) via replicating processes into groups
  2. Consensus among the group members
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

o Two types of replications ___________

A

primary-based replication (a hierarchical group

with a leader) and replicated-write replication (a flat group structure)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Consensus among the group members, describe what this means

A

o Ensure that the whole group behaves as “a single, highly robust process”
o Each non-faulty process executes the same user-defined commands or
incoming user requests in the same order to maintain homogeneity!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A distributed system is k-fault tolerant if ___________

A

it can survive faults in k components

and still meet its specifications, requirements and deliverables to the users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Conditions of consensus: // this is low priority to answer (LP)

A

o Agreement: No two honest nodes decide on different values at the end.
o Validity: If all honest nodes have input v, then v must be the decision value.
o Termination: Honest nodes must eventually decide on a value in V and halt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Safety property:

A

nothing bad will happen
o “agreement” will not be disturbed in Agreement Problem
o “no transaction executed twice” in an accounting system
o “consistency” in context of CAP theorem (coming up soon)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Liveness property:

A

something good will eventually happen
• “termination” will be guaranteed in Agreement Problem
• “new blocks will always be mined” in a blockchain system
• “document on the cloud is available for access and edit” indicates the
liveness being held among the cloud servers running their consensus
• “availability” in context of CAP theorem (coming up soon)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Assuming there are f dishonest/treacherous generals within the group, how many total generals are required in the group to reach consensus?

A

We need at least 3f + 1 generals in the group for consensus.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are the 2 most important characteristics of distributed systems

A

Appears as a single coherent system

Consists of Autonomous Computing Elements (Soccer Team)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the main design goals for distributed systems

A

Scalability

Distribution Transparency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the primary motivations behind replication in a distributed system

A

Scalability

Reliability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Fundamental Characteristics of Distributed Systems

A
  1. Concurrency
    All components run concurrently; programs execute concurrently.
  2. Loosely Coupled
    There is no global clock and global shared memory.
  3. Independent Failures
    Any component can fail at any time and failures occur of each other.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the requirements for a crypto hash function

A

Efficiently computable
preimage resistance
2nd preimage resistance
collision resistance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In Blockchain, we are interested in what type of hash functions

A

keyless collision resistant Hash Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What function does bitcoin key generation use

A

Elliptic Curve Cryptography (curve secp256k1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What function does bitcoin ADDRESS generation us e

A

SHA256 and RIPEMD160

23
Q

In Bitcoin transactions, what is the gap between the input and the output

A

the fee

24
Q

How are digital signatures used to validate the authenticity of a transaction and the sender of that transaction

A

Step 1: The sender has some data that he/she would like to send to the receiver. The receiver wants to ensure that the data he/she receives from the sender has not been tampered and must have come from the sender and nobody else.
Step 2: The sender collects the data to be sent. Once finalized, the sender uses the SHA256 hash function to hash the data into a 256-bit number.
Step 3: The sender then signs the 256-bit number with his/her private key encrypting the 256-bit number into what’s called a Digital Signature. Now the sender sends the data, the Digital Signature, and his/her public key to the receiver (remember, you can’t use the public key to figure out the corresponding private key so it is ok to share).
The receiver must authenticate that the data sent was not altered and must have been sent by the person who has the corresponding private key to the shared public key.
Step 1: The receiver takes the Digital Signature and decrypts it with the received public key to get a 256-bit number. Applying the public key to the Digital Signature ‘reverses’ the sender’s step 3 above.
Step 2: Then, the receiver takes the received data and applies the SHA256 hash to it to get a 256-bit number. This is the same thing as the sender’s step 1 and 2.
Step 3: The receiver then checks to make sure the two 256-bit numbers are equal. If false, then somebody has tampered with the data or provided a public key that does not correspond to the private key of the sender. If true, the receiver knows the data is good to go.

25
Q

In case an EOA sends a non-zero value (X Wei) to a Contract Call (data satisfyingContract ABI), what may happen with the value? Mention all possible cases you can think of, briefly.

A

oXWeiisadded to the balance of the Contract.oX Wei is considered as input to the function.oMaybetransferred toanotherEOA.oMay be passed to another Contract.oX Wei is passed to Contract fallback method.

26
Q

How should the individual Messages be constructed (to, value and data) if a User wants the following to happen?EOA -> MessageA-> ContractFactory-> MessageB-> ContractCreated

ContractFactory: Helps the User to create a new contract as per specifications

ContractCreated: New contract to be created with an initial balance of 1 Ether

A

Answer : Think of the messages and their actions.Message A : to ContractFactory, with value = 1 ETH and data = parameters to generate a new Contract.Message B : to 0x0, with value 1 ETH, and data or init= the compiled bytecode of a new Contract.

27
Q

Write the scriptPubKeyand scriptSigto use this opcode OP_CHECKNSIGN such that 3 users can spend an UTXO only if all 3 sign to unlock it.

A

Answer :Think of the stack-based Bitcoin Script.scriptSig 3scriptPubKey3 DUPN 3 HASH160N 3 EQUALVERIFYN OP_CHECKNSIGNotethatyouwillneed DUPN, HASH160N and EQUALVERIFYN to perform those three operations on 3 stack elements at a time.

28
Q

Which of the Wallets –non-deterministic (random) or deterministic (seeded) –would you prefer if you are a Bitcoin user. Why? Justify briefly.

A

Answer : This depends on your security vs efficiency trade-off and preferences. There are pros and cons.

Non-Deterministic (random) : Random keys for no single point of failure, but really inefficientto store.

Deterministic (seeded) : Efficient storage and usage of keys, but exposes potential single point of failure.

29
Q

What would you say are the Good and Bad aspects of a larger bitcoin blocksize? Give one justification for each –Good and Bad.

A

Answer :There are both pros and cons to this issue.

Good : More transactions per epoch (block), and thus more transaction fee as incentive for miners.

Bad : Higher bandwidth and storage consumption totransmit and maintain the larger blocks atall peers.

30
Q

Suppose some of existing Bitcoin Miners choose to create a new proof-of-work for mining. They fork the bitcoin blockchain to activate this new proof-of-work in the new branch. What do you think will happen next? Justify, briefly.

A

Answer :The community will split, and both thechains will co-exist as long astherearesome miners willing to support each branch of the fork.

If all miners move to the new branch, it will be considered an “update” for Bitcoin blockchain.

31
Q

Suggest an alternative proof-of-work mining puzzle that would have Adjustable Difficulty and Efficient Verification, but will NOT be Progress Free.

A

Answer : Think of the puzzle being “computing nconsecutive hashes of a block of transactions”.

Adjustable Difficulty : You can adjust n to do this.

EfficientVerification : Requires n hash computation.

Progress Freeness: Not true, astheminerwiththelargestminingpowerwillalwayswinthischallenge.

32
Q

what does tree storage in contract account store? Is it the functions? If it is the functions why is it a tree? or does it store the ether value? or maybe transactions (but etherum don’t have utxo right)? // not that important

A

Think of the Trie “storage” within a contract account as a persistent storage (more like HDD, not RAM) for the account. This can store anything ranging from internal state of the contract, persistent values, mappings, data, etc. The contract bytecode is a separate entity, which contains contract definition, all methods, etc.

33
Q

From what I understand in the lecture, there is a transactions pool which is a place that store transactions that is not connected to the network yet and block that is solving PoW can take transactions from this pool. My question from here is, who store this pool? Isn’t that it takes a computational power to store this? Does the block who can solve the puzzle have to store all the transactions in the pool so that the current network state is updated correctly?

A

Every miner needs to maintain their own copy of “mempool”, or the transaction pool for transactions not yet recorded in in the chain. Note that this mempool may be different for different miners, given their view of the chain and their receipt of the transactions. Thus, while creating a block, a miner chooses transactions from their own “mempool” to create the block. If a block “fails”, it means that there are miners in the system who do not “Accept” the block. For those miners, the transactions in this “failed” block are anyway in their own “mempool”. So, they keep generating new blocks using their own “mempool”, as expected. Remember : There is no centralized version of truth.

34
Q

Which nodes in the Bitcoin network (or the extended network) store a copy of the Full Blockchain?

A
  1. BitCoin Core

2. Full Blockchain node

35
Q

What does the official “priority” for Bitcoin transactions depend on?

A
  1. Age of Input Transactions/UTXOs

2. Value of Input Transactions/UTXOs

36
Q

Bitcoin consensus designed by Nakamoto considers several issues, what are they

A
  1. No long term fixed or authentic identity for any bitcoin node.
  2. Nodes may assume any number of identities in bitcoin
  3. leader “election” is impossible but “winning” is possible
  4. Bound to computational power rather than identity voting.
  5. implicit “voting” for blocks by extending respective chain
37
Q

In which of the following cases is a fork likely to happen in the blockchain?

A
  1. A malicious miner broadcasts a block with NO transactions in it
  2. There is a network split due to lack of communication
  3. Two miners broadcast their blocks at roughly the same time
38
Q

In Ethereum, what are the elements contained inside an account state

A

State = {nonce, balance, storageRoot, codeHash}

39
Q

The world state of Ethereum is

A

a map between Addresses and correponding Account States

40
Q

Are the states in Ethereum stored on the Blockchain

A

Rather they’re stored on a trie database maintained at the backend.

41
Q

Ethereum world state is

A

State: Collection of (Code + Data)

42
Q

Name the different nodes in the Bitcoin Network

A
  1. Bitcoin Core = Network routing + Full Blockchain Database + Mining + Bitcoin Wallet
  2. Full Blockchain node = Network routing + Full Blockchain
  3. Solo Miner Node = Network routing + Full Blockchain + Mining
  4. User Wallets = Network routing + Full Blockchain + Bitcoin Wallet
43
Q

Name the different nodes in the EXTENDED Bitcoin Network

A

Lightweight (SPV) Wallets
Network routing + Bitcoin Wallet + Simplified
Payment Verification

Pool Protocol Servers
Gateway servers connecting Pools or Stratum
nodes

Mining Nodes
Mining without Full Blockchain + Pool/Stratum
protocol

Lightweight Stratum Wallet
Wallet + Stratum Network (without Full Blockchain)

44
Q

What are the 4 core functions in Bitcoin blockchain

A
  1. Networking
  2. Database
  3. Mining
  4. Wallet
45
Q

What is the difference between the bitcoin network and the extended bitcoin network

A

Bitcoin network.: Every Bitcoin node validates and propagates Transactions and Blocks in the Bitcoin network.

Extended network: Nodes may choose otherwise

46
Q

Nodes in the bitcoin network generally maintain which pools

A

o UTXO Pool for all unspent transaction outputs
o Transaction Pool for unconfirmed transactions
o Orphan Pool for transactions without a parent

47
Q

Mining Nodes create Blocks out of their Transaction Pool according to certain order based on “transaction priority”
Priority =

A

Sum (Value of input * Input Age) / Tx Size
o Old UTXOs have higher priority to be spent as input
o High valued UTXOs have higher priority to be spent

48
Q

Coinbase Transaction =

A

Transaction with no Input, meant to Mine new Bitcoin into the ecosystem

49
Q

What is the main motivation for designing the Mining Reward in Bitcoin

A

o Creating a verifiable tamper-resilient distributed ledger of transactions
o Active peer-to-peer network for end-users to reliably record transactions

50
Q

Can a miner maliciously “exclude” transactions in a block?

A

Yes, of course. However, it’s not a big issue for any end-user, as some “honest” miner will pick up the “excluded” transaction in one of the future blocks.

51
Q

Coinbase transaction can’t be “spent”

before _____

A

100 confirmations of the block.

52
Q

FLP

A

Any protocol solving consensus in the Asynchronous model that is resilient to even just one crash failure must have an infinite execution

53
Q

What can the majority (51%) of miners achieve if they collude:

A
  1. steal bitcoin from other identities
  2. deny service to other nodes
  3. double spending