Bitcoin Flashcards
Difficulty in Bitcoin
Adjusted so that block generation time takes 10 mins
~ time = difficulty * 2^32/hashrate
If previous 2016 blocks took less than 2 weeks => difficulty increaseed
more => diff increased
Merkle trees
Only merkle root is published in block:
If user wants to confirm transaction is in block he is provided with each node that he needs to compute the root => log2(n)
Proof of Work Header
block version, hash of prev block, merkle root, time stamp, current target, nonce
Common prefix
Each honest participants local chain without newest k block is prefix to local chain of other participant
chain quality, chain growth
cq :If an honest majority exists the chain will contain atleast some blocks mined by an honest party
cg: blockchain will grow eventually
Double spending if confirmation skipped
- send tr_v to vendor and tr_a to the network
- propagate tr_a to network with helper nodes
- no detection required
countermeasures to double spend
Listen to the network: Problem attack can get tr_v to neighbour nodes of vendor first
Get help in network: Observers in the network check if transaction is in network but requires multiple observers
Forward first double spending transaction
selfish mining
Mine on your own “secret chain”. If other miners discover a block publish your own block and try to transmit it faster. Else adopt new block.
Eclipse attack
Big Scale Attacker that has control over many IP addresses
=> DoS Bitcoin client and thus control their view of the blockchain
Populate tried tables with your own IP addresses and new table with non existing IP addresses => Victim can only connect to adversary
Will continue until client is restarted.
Splits the mining power, can increase advantage, can double spend
Eclipse attack counter measures
1: make sure that the same address hashes to the same bucket at the same location
2: avoid recency bias in choosing new addresses
3: make sure that ip address exists before replacing ip at new or tried
4: add new buckets
Partial eclipse attack
Bitcoin uses inventory based request:
inv, getheader, getdata, sendheader, senddata
Clients wait 20 mins for block and 2 for transaction
Try to send many invs to victim to populate fifo queue => no getheader messages. No receive version message => exhaust
Implications:
1. split mining power
2. increase advantage => only 34% of computing power needed
3. bypass double spending countermeasures
4. can double spend (using weak miner)
Partial eclipse countermeasures
- Dynamic timeouts
- handling transaction ads: filter ip, randomly choose sender
- update block advertisements. broadcast header instead of hash
=> header => getdata => block