6 ms·
Read 'Mastering Ethereum' https://www.amazon.com/Mastering-Ethereum-Building-Smart-Contracts/dp/1491971940 https://www.amazon.com/Mastering-Ethereum-Building-Sm
by jll29 4y ago
Read 'Mastering Ethereum'
https://www.amazon.com/Mastering-Ethereum-Building-Smart-Contracts/dp/1491971940 https://www.amazon.com/Mastering-Ethereum-Building-Smart-Con...
The short of it is:
- The block chain is a distributed ledger database, where all peers hold a full copy to avoid manipulation (faking an entry is only possible by controlling >50% of machines in this peer-to-peer network).
- Spending money is implemented by adding a transactional record to the blockchain ledger at the end saying X amount moved from account A to B. A block is like a page in a paper ledger and they are appended with cryptographic hashes to avoid improper interference.
- Ethereum supports smart contracts, which are little scripts in a language called Solidity. So you can implement legally binding (and unstoppable) contracts along the lines of "if (condition) then (pay some money to someone)". Executing smart contracts cost a little bit of money. All Ethereum nodes collectively implement a distributed VM, and that money (called "gas") is the incentive to keep the network running. Smart contracts are highly interesting, and they have applications far beyond electronic currencies. For example, we played with implementing electronic rights management (https://link.springer.com/chapter/10.1007/978-3-030-36691-9_22 https://link.springer.com/chapter/10.1007/978-3-030-36691-9_... - which turned out to be less than ideal due to a stack size limit in the current Ethereum VM, but hey).
- Whenever a new block (page in the ledger) needs to be created because the previous one is full, a randomized alg. determines who is permitted to do that ("mining"). The old process (proof of work) was environmentally a disaster (it still is for the Bitcoin ecosystem), which is why the Ethereum people implemented a smarter method (proof of stake - https://en.wikipedia.org/wiki/Proof_of_stake https://en.wikipedia.org/wiki/Proof_of_stake).
- FearNotDaniel 4y agoExcellent and very clear summary, as far as I can tell. My only niggle is that smart contracts are, in practice, neither legally binding nor unstoppable... the story of the DAO Hack/Hard Fork [0] proved that consensus can overrule "the invisible hand of the blockchain" during a particularly egregious incident. [0] https://ogucluturk.medium.com/the-dao-hack-explained-unfortunate-take-off-of-smart-contracts-2bd8c8db3562 https://ogucluturk.medium.com/the-dao-hack-explained-unfortu...
- tornato7 4y agoEverything comes down to social consensus at the end of the day. But for 99.9999% of transactions you can count on immutability.
- pjc50 4y ago"99% of the time it works every time"
- Intermernet 4y ago"One in a million chances come up nine times out of ten"
- nisegami 4y agoThat's substantially higher than the legal system in any country
- jollybean 4y agoExcept when you can't and you must undo a transaction, and if you can't, you can't use it. Like for example in the world of finance, where you have to be able to backtrack. Meaning such 'contracts' are least useful for things like, well, 'currency' and 'stores of value' ... hmm ...
- syzygyhack 4y agoSounds like you haven't wrapped your head around the basics of smart contracts. Yes, a blockchain gives you an (ideally) immutable foundation. No, that doesn't mean that every transaction that invokes a smart contract has to be immutable. If a smart contract for a particular use case needs to have the ability to "backtrack", so it can, there's nothing stopping it.
- johnnymorgan 4y agoGreat reply, the rule for thumb of 'anything that can be done manually can be automated' applies here. Needs backtrack, code it in, then everyone knows how the rules work and there isn't any side deals or exceptions. Cheers!
- mudrockbestgirl 4y agoMastering Ethereum is great, and the high-level concepts all still apply, but I think it's important to mention that quite a bit of it is outdated. Basically, imagine you're reading a book on Kubernetes from a few years ago. Still applicable, but some of the details and API interfaces will have changed.
- davnn 4y agoI very much enjoyed Andrej Karpathy‘s „from scratch“ bitcoin implementation [1]. I‘m sure there are other projects on GitHub explaining blockchain concepts directly in code. [1] https://karpathy.github.io/2021/06/21/blockchain/ https://karpathy.github.io/2021/06/21/blockchain/
- williamcotton 4y agoI love this work on a general ledger for electronic rights management! A bit off-topic, but do you think this kind of rights management ledger is better stored and accessed in traditional data stores and managed by either a government entity or a private-public partnership of some sorts? It seems like self-signed authentication would still be viable but with the added bonus of a mechanism for dealing with lost private keys while at the same time allowing for individual entities to quickly and effortlessly exchange ownership.
- jollybean 4y ago"So you can implement legally binding (and unstoppable) contracts " No - they are not necessarily legally binding. They are just called 'contracts'. We have no idea what they mean, and each individual 'contract' will have to be scrutinized by the Judge, or else it's not 'legal' anything.
- imtringued 4y agoEvil Supervillain: "Darn you jollybean! You have foiled my plan to make slavery legal via an unstoppable smart contract by stating the obvious. If only you didn't exist I would be the ruler of earth!"
- actionfromafar 4y agoAll very good, except whether the contracts are legally binding is completely orthogonal to how they are implemented and executed.
- johannes1234321 4y ago> you can implement legally binding (and unstoppable) contracts I would just call that "automated decision" The legally binding contract is the one where the parties agree on using the implementation as their means to fulfill the contract. There is nothing legal related in that and no law in any legislation I am aware of giving it any special treatment.
- matheusmoreira 4y ago> The old process (proof of work) was environmentally a disaster (it still is for the Bitcoin ecosystem) There's no problem with spending the energy if it actually buys us something. It's a disaster because it failed to actually decentralize the network. Instead of everyone with a computer being able to participate, we have very few people buying up all the hardware for their massive centralized mining operations. If that's how it's going to be, then we might as well move on to proof of stake. Monero seems to have a better designed proof of work system. It's ASIC and GPU resistant, normal people manage to use their computers to mine XMR. One CPU one vote, that was the whole point since the beginning.
- MuffinFlavored 4y ago> contracts along the lines of "if (condition) what are some examples of these conditions? how is it not like... i put money in escrow, if the buyer agrees i did my part, they click agree and that's the "condition"?
- MuffinFlavored 4y ago> where all peers hold a full copy how large is a full copy these days? how are peers jump started and why is that mechanism trusted so well? like say I want to connect to the blockchain, I need to make an API request to some IP. how is that resolved and why is that regarded as "decentralized"? why is the mechanism for serving me peers trusted and why is every peer in the network trusted?
- warkdarrior 4y agoIt's between 800GB and 1.2TB total, depending on whether you just need to validate future transactions or past txns as well. Source: https://etherscan.io/chartsync/chaindefault https://etherscan.io/chartsync/chaindefault
- randomsearch 4y agoFantastic thanks. Care to take a go at explaining at a similar level PoW vs PoS?