6 ms·
How does blockchain really work? I built an app to show you
- phaemon 9y agoA good and interesting explanation. Though, since it doesn't mention transactions at all, it might leave folk thinking, "So great, I've got a chain of hashes. How is that in any way a `coin`"? A Part 2 with that concept would be excellent. Also, tiny nitpick, but `bc` is a common unix command, so maybe a different shortname would be better.
- yladiz 9y agoI don't think that's a tiny nitpick, 'bc' shouldn't be aliased unless the user directly does it.
- ringaroundthetx 9y agoWell coin was always a misnomer and skeumorph, because chain of hashes is even less relatable. But hey since it is a decade later now, and iphones no longer show pictures of an address book for your contact list, maybe we can also drop the -coin and -currency monikers and call it distributed hash chain accounting networks! There is a known quantity of hashes.
- libertymcateer 9y agoI actually would very much appreciate that. I was just reading Nakamoto's whitepaper on Bitcoin [1] and I understand the hashing. However, the coinebase transaction is still a bit confusing to me. Specifically, to get at precisely this issue - what does the bitcoin itself consist of? It is just the summation of the history of transactions to and from an address? Or is there a numerical value or token that is actually issued during a coinbase transaction, and, if so, how is it generated? This is not apparent to me. I understand that during a coinbase transaction, there is a transaction registered that is issued to the miner and the 'from' address is null - but it is still not clear to me, other than the balance of that transaction, if there is an actual token associated with those coins. Any explanation would be greatly appreciated! [1] https://bitcoin.org/bitcoin.pdf https://bitcoin.org/bitcoin.pdf
- Jasper_ 9y agoThe core idea is that there are a number of coins "floating out there in the open" which you can use in your transactions, as Inputs. These Inputs can be used in transactions as long as you publish data which can solve a riddle put forth by a Script. So, your balance is basically any those which you can easily use as Inputs. The most traditional way of tracking this is that you use a standardized script format called P2PKH (Pay 2 Public Key Hash), and software like a wallet scans the transactions for any scripts that have your public key mentioned in a P2PKH template. So, once you want to send money to someone else's wallet, you answer the riddle of the script (in P2PKH's case, by signing something and proving you own the public key) allowing you to do whatever you want to that Input. A key thing is that if someone pays you 3BTC and someone else pays you 2BTC, then you have 5BTC in combined inputs. To pay someone else 4BTC, you use both those Inputs and make two new ones: 4BTC P2PKH to someone else's public key, and 1BTC back to your own "change address", which is just an Input that you can reuse again. A wallet broadcasts transactions into the network, where they float around until a miner takes those transactions, puts N of them into a block, then, as part of that block, they can use an extra magical coinbase Input which gives them 12.5BTC out of thin air (originally 50BTC, halves every so often) which they can lock under any script they want.
- Doxin 9y ago> It is just the summation of the history of transactions to and from an address? It is. Imagine the blockchain as a democratic ledger. As long as most people agree a certain transaction is valid it then is valid. This allows for tricks like creating bitcoins out of thin air as long as everyone agrees you "deserve" those bitcoins. For example if you confirm enough of other peoples transactions (which you can do because the ledger is public) most everyone will agree that a transaction from nowhere to an address of your choosing is valid. The amount of bitcoins in your possession is just the amount of bitcoins ever transfered to addresses to which you own the private key, minus the transactions out of those adresses. You shouldn't think of bitcoin as a virtual coin. That's a fairly bad metaphor. It's not some actual thing, It's more like the balance in a ledger.
- libertymcateer 9y ago
- hdhzy 9y agoBlockchain reminds me of monads... In a way that everyone is writing tutorials about it but the underlying concepts are quite simple. Do we have Blockchain tutorials timeline akin to https://wiki.haskell.org/Monad_tutorials_timeline https://wiki.haskell.org/Monad_tutorials_timeline ?
- atonse 9y agoI understand the cryptographic concept of a blockchain but have a bunch of "real-world scenarios" type questions on how it actually works. Like for example, it's a chain. I get that. But if there are thousands of people adding to the chain all the time, how do they coordinate to make sure they're always adding to the last block? Because this might happen: - I sync and have the latest block - I build another block off the latest block (takes 1 second) - In that time, I no longer have the latest block. Do I have to get the newest block again from the "world" and then recompute? Wouldn't this just be never-ending? And how would this work as more people add to the chain? Would I constantly be out of sync? That's the kind of stuff where I'm completely lost and haven't found a good explanation for it.
- hanbura 9y agoThis happens fairly frequently. Whenever you see a new block that forms a longer chain than the chain you currently know, you throw your work away and use that block as your new starting point. But you only do that if the new block has a longer chain, not for a chain of equal length. So if two miners both mine a new block that follows the same block, one will be seen first by some miners, the other will be seen first by others. That gives them different mining power, meaning the chains grow with different speed. After 1-3 blocks this mining power difference will lead to one of both chains being longer from everyone's point of view. At that point the longer chain won, the shorter is forgotten and all work put into it becomes worthless. That encourages miners to make sure they use new blocks as fast as possible. Unless of course you have more mining power than everyone else combined.
- annabellish 9y ago
- rebuilder 9y agoWhy are we now treating "blockchain" as an uncountable concrete noun? I know it's not a new phenomenon, but it's not getting any less perplexing.
- platz 9y agoI am a blockchain https://twitter.com/LIL_ICEBUNNY/status/887667332562202624/video/1 https://twitter.com/LIL_ICEBUNNY/status/887667332562202624/v...
- marssaxman 9y agoIt is an awkward and baffling usage.
- andrewfromx 9y agoLove this stuff but I want to make it even easier to explain to non programmers. I just registered the domain lowsec.coin and I want to build a new currency from start to finish in a way kids can grok. Working domain is https://higher.team https://higher.team
- nonidit 9y agoIn your explanation you say that "The SHA256 algorithm will calculate a unique hash, given those inputs.". Obviously, this can't be the case (since the number of possible hashes is smaller than the number of inputs). It is just very unlikely, that the same hash appears twice.
- lambdaxdotx 9y agothis is quite the nitpick... for all intents and purposes, sha3_256 will _not_ collide; it's infeasible to the point that it can be said that the resulting hash is unique. I mean, of course you are technically right, but sometimes all the details are not worth mentioning when explaining a lot of small parts of a bigger picture.
- machiaweliczny 9y agoExplanation on 3blue1brown YT channel is best I've found so far