Blockchain Technology Flashcards
1
Q
bitcoin vs bitcoin cash
A
- split based on how to deal with slow transactions
Bitcoin
- started using segregated witness (SegWit2x)
- reduces amount of verification data for each block
- Bitcoin also plans to double block size (to 2mb)
Bitcoin Cash
- felt SegWit2 didn’t go far enough
- increases block size to 8mb (up from 1mb)
2
Q
hash functions
A
Consists of:
- input: message
- can be any length
- output: digest, tag, hash, fingerprint
- fixed in length
Desired traits
- should be fast
- collision resistant
- hard to infer anything about input
- was it even or odd
- well distributed (should look random)
3
Q
51% Attack
A
- hypothetical in which one actor aquires control of over 50% of mining rigs
- can double spend
- can prevent others’ transactions
4
Q
digital signature
A
- scheme for verifying the completeness of a message and the identity of its sender
- Examples: RSA, DSS
Steps
- Alice wants to sign a document
- Alice generates 2 keys
- Private key
- Public key
- They’re generated at the same time
- Cannot get private key from the public key
- Alice hashes the document with private key to produce signature
- Bob wishes to verify the message (does this message really generate this signature)
- Bob uses a verification function on the message, signature, and public key determine if message is valid
5
Q
bitcoin block
A
- a grouping of individual transations
Includes
- mutliple unrecorded transactions
- a special transaction representing miners’ reward
- an encoding of previous transaction block (to ensure continuity)
- a proof-of-work puzzle
6
Q
bitcoin transaction - steps
A
Steps
- Alice wishes to send money to Bob
- Alice uses a bitcoin client to record transations in ledger
- Alice specifies
- Hashes from previous transactions to her account (verifying that she has the money to begin with)
- List of recipients for bitcoin (their public keys)
- Amount to transfer (usually less than her present balance)
- Specify change going back to her
- Leftover money is used for transaction fee
- Takes transaction details and generates a digital signature
- Alice appends transaction with digital signature
- Alice broadcasts complete transaction
7
Q
bitcoin mining - steps
A
- miners confirm the order in which transactions take place in order to prevent double-spending
Steps
- Miners gather transactions that haven’t been mined into a block
- Also adds an additional transaction representing his reward
- coinbase/generation transaction
- how new bitcoins are created
- Starts hashing them in pairs to get a single digest value
- Hashes this transaction with most recent block in network to produce a number
- Convert that number into a challenge (for proof-of-work)
- Miner performs proof-of-work
- He generates many potential proofs to the challenge until one works
- Once found, miner announces proof
- This miner’s blockchain becomes the new official chain; other miners build on it
- The more leading zeros required, the more difficult it is to generate a proof
- Number of zeros is calibrated so that it takes a node, on average, 10 minutes to find a proof
8
Q
longest chain
A
- chain with PoW puzzles that were the most difficult to solve
9
Q
bitcoin money supply
A
- money supply limit is 21M bitcoin
- every time 210K blocks is generated, reward gets cut in half
- it takes about 4 years to generate 210K block
- entire supply will be generated by 2140
10
Q
proof of work
A
- a security measure/intentional hurdle incorporated into most crytocurrency protocols
- PoW puzzles have a difficulty score that describes how hard puzzle is
- puzzles are difficult to solve but easy to verify
Steps
- Imagine there’s a challenge string
- Miner generates a random number, called a “proof” or a “nonce”
- He then concatenates the challenge string and the proof
- And hashes the result
- If the hash has the requisite number ofleading zeros
- Then the challenge has been solved
- There’s no effective way to guess or infer the solution, so the miner has to do this with brute force
11
Q
proof of stake
A
- bitcoins are assigned a stake value
- value grows as long as bitcoin isn’t used
- when bitcoin is used for transaction, “stake” value is reset
- people who make fraudulent confirmations will lose money
- in PoS, blocks are forged, rather than mined
- the probability that an individual can forge a block is proportional to the stake they have
12
Q
ethereum tokens
A
- boost ether’s value by creating a need for the currency
- issued via crowdsale called Initial Coin Offering (ICO)
- ERC20 is a standard interface for tokens
- Must implement the following:
- get the total token supply
- get the account balance
- transfer the token
- approve spending the token
13
Q
hashrate
A
- measure of mining power
- number of nonces tried per second normalized by rashrate of the network
14
Q
asic
A
- application-specific integrated circuit
- circuit that is designed for a specifc purpose
- ex: video graphic cards
- asic resistence
- memory-hard puzzles
- memory doesn’t improve as quickly as processing speed
- puzzles that require memory won’t advantage asic as much
15
Q
externally owned accounts
A
- EOA
- accounts that are owned by a private key
- cannot contain EVM code
16
Q
byzantine fault tolerance
A
- ability of a distributed network to handle the byzantine generals problem
17
Q
two generals probelms
A
- example of a consensus problem
- there is no perfect solution
Setup
- Two aligned armies (A and B) have to decide whether to attack their opponent (C) tomorrow morning
- They will win if they attack together, but lose separately
- The armies are separated by the territory of army C
- They communicate through courriers, which may or may not make it
- They attempt to send messages back and forth in order to reach consensus
18
Q
byzantine generals problem
A
- example of a consensus problem
- generalization of the two generals problem
Setup
- a number of byzantine generals getting ready to attack a fortress
- must decide if they will attack or retreat
- but some generals might be traitors
- the goal is to reach consensus even though one or more generals is a traitor
- traitors can tell send different messages to different generals
- how many traitors can the system tolerate?
- (must be < 1/3)
19
Q
double spend
A
- a deliberate fork
- first, agent spends bitcoin
- then agent creates another block at same level to send bitcoin to another person, and starts mining on that chain