Notes from discussions with Tara about how blockchain works on a fundamental level (cryptographically, mostly). Boy oh boy did it start to be over applied. Rich people just trying to figure out an easy way to make a buck.read more
Key takeaways: a transaction processes by waiting until enough blocks have been added such that the cost of a malicious party adding those blocks would outweigh the benefit they stand to gain by double spending your transaction. What if a malicious party manages to centuple spend? They could make it so all the transactions in there add up to something worthy of their time even though any individual one would not be worthy. That way they could convince each party to wait? Or maybe not, they'd need some ending buffer which would be hard to do. Neighborhood advantage: if you successfully mine at the same time as someone else, you will want your fork to win, so you will be more likely to win if the local nodes (ones near you who received your version of the fork) will succeed faster than the local nodes of the competitor who mined at the same time. The public and private key are inverses. If someone encrypts with your public key (encryption), you can decrypt with your private key (decryption). Likewise, if you encrypt with your private key (generating a signature), someone can decrypt with your public key (signature verification). A transaction seems to contain: (in plaintext) timestamp, transaction (who paid, who received, how much), and then a cryptographically signed copy of that transaction by the person who paid. To verify transaction: check that the claimed payer's public key can decrypt the signature and the result matches the plaintext. How does someone steal your money? They steal your private key, then sign a transaction as you saying you transfer all your money to them. You don't necessarily need to tie identities to keypairs, making it possible to have anonymous transactions. To compute someone's balance: you just go through all transactions in history and sum the ones involving them. Apparently you can also "transfer debts", by doing a hash of the transaction you want to transfer and then including that hash as the "what are we transferring" in a new transaction. Why is this necessary? Maybe if you are owed money, and someone won't allow you to go into debt to them but they'd allow someone else (more reputable) to? Essentially before doing any transaction you'd want to go through and make sure the chain up until that point is valid and that the person you're doing a transaction with has necessary funds or you're willing to allow them to owe you a debt. Bob can do a double spend, though, by quickly going to two people and saying they have money and buying something before those two people have communicated about the fact that Bob is out of money after their transaction. A bunch of stuff is necessary to protect against this. Mainly, some way of agreeing which ledger is "right", which must be agreed upon by everyone in the system. So you do have to have some standard rules, some protocol of how to handle situations. Downfall: what if a majority of people just do not like someone, can't they essentially agree that all of their money should be taken away? That is, what happens when you have an irrational majority? Downfall: what happens when a majority or even a large quorum of people have compromised software that results in misleading votes being sent out? Very interesting: to get confirmation that a transaction is valid by reaching out to N peers, you reach out to N peers such that the cost of running N peers is greater than the transaction value, which means it's not feasible for that party to secretly be running all of those peers. You can adjust N to be large, or you ask each of the N to solve a hash problem such that the total cost of all N to do that hash problem is greater than the transaction value. Blockchain is fundamentally: a distributed (P2P) book keeper.