From the course: Blockchain Programming in iOS Using Swift

What is a distributed ledger?

- [Instructor] Let's say that John needs to send some money to Mary. And once again, we will assume that they are not next door neighbors, but they live thousands of miles apart. In this case, we are not really going to use a middleman, or a central ledger approach, which we used the last time. Instead of that, we will use different nodes. Now, you can think of these nodes as different servers which people are running. These are the volunteers, they are running these nodes. Each node has a copy of a ledger, which can record a transaction. So if John is going to say that, hey, I want to send $20 to Mary, all of the ledgers on different nodes, and these can be thousands of nodes, gets updated with that particular transaction, saying that John wants to send $20 to Mary. Now, this is not only limited to John, because a different person, like Steve, can come in. And he say, you know what, send $5 to John. And all the ledgers get updated, saying that sent $5 to John. The same way Mary can also say, send $15 to Steve. Once again, all the different ledgers on all the different nodes, and there can be thousands of different nodes, get updated. Now, what happens if Steve is not a good person, and Steve is like, I want to change something in one of the ledgers, so he hacks one of those nodes, the server, and changes a transaction and say send, instead of $15 from Mary to Steve, to $115. Now, the great thing about these nodes is that they are on a peer-to-peer network, so all of these nodes are actually connected to each other. And when one node makes a change, it is validated against all the other nodes. So all the other nodes are going to verify that their ledger is the updated one. And now you can see that there are three nodes which say something different than the one top-right node, which say it's a completely different thing. So we will ignore that node, we will ignore that particular ledger or that transaction, because something wrong with that. All the three nodes have a different copy of the transaction, and one of those nodes has a different copy. Since three in a democracy will win over one, we will keep the copy which does three have, because that might be the correct copy. Now of course, I'm making this super simple. A lot of different things go on behind the scene. A ledger is not really displaying you the name of the people who are sending money from and to. And that is exactly what we are going to learn in the next lecture. We're going to learn that what the ledger looks like, and how the ledger does not really include the name of the people, but actually the ID of the people that is generated and assigned to them.

Contents