Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save julienreszka/87b5ca6bb71fbfec5455a7f6db176fb3 to your computer and use it in GitHub Desktop.
Save julienreszka/87b5ca6bb71fbfec5455a7f6db176fb3 to your computer and use it in GitHub Desktop.

How The New Boston digital currency works

Transcript from the video

https://www.youtube.com/watch?v=Dgj_OStjD1Q

The goal of this project is to build the most reliable, secure and fastest digital currency in the world.

It is a peer-to-peer network and it's made up of 3 different types of nodes, three different types of servers.

The Bank

The banks are there for users to connect.

So we'll say we have a user and we can just assume they already have the new boston app downloaded on their phone fantastic now the bank is essentially how users hook into the network.

Users get to choose their own banks and also this is where they are going to be sending their transactions to.

So we'll say that this is me so whenever i am paying someone else, say i'm paying Sally, whenever I am paying her, I'm gonna generate that transaction on my phone and then I'm gonna take it and send it to the bank so that's essentially what the bank is for to maintain a server so that all these end users they don't have to always maintain their own servers constantly anytime they want to use the network.

Another thing, aside from just accepting these transactions is that whenever a new transaction comes in the bank, the bank is going to be listening for those transactions and once it sees: "oh this is Bucky and he belongs to this bank, i'm going to stream down that notification to his phone"

That is essentially the first job of the bank

The bank also has one other very important job and that is to choose another type of node called a primary validator.

The Primary Validator

A primary validator is the one server that the bank trusts the most out of the entire network.

The bank chooses a primary validator very carefully because the primary validator is responsible for some key actions, the first is validating transactions.

Whenever Bucky sends a transaction, what the primary validator is going to do, is they're going to look and say "okay how many coins is Bucky trying to send, well he's trying to send 8, if he has 10 coins in his account that's good everything looks chill, if he only has three coins in his account and he's trying to send eight, then obviously that's no good".

That's the first job of the primary validator.

Another job is updating account balances

In this transaction you're gonna have let's say Bucky with 10 and we'll say Sally she has 0.

When Bucky sends eight to Sally, the ending account balances should be Bucky two and Sally with eight so this right here this balance sheet, it's the job of the primary validator to update these balances for both the sender and the recipients.

In addition to that it's the primary validator's job to maintain the single source of truth for all account balances across the entire network.

The reason that the network is architected to have a single primary validator is because if all servers in the network are able to reach a consensus on the single server that is going to act as the primary validator then what that means is that all servers all those banks are then able to forward their transactions to this one server, and this primary validator can just process those transactions as fast as possible so it's a very very performant way where the blockchain can be built very quickly.

There's a big problem with that and that is what's to stop the primary validator from just going in and updating anyone's account balance?

I mean, if they are the only one controlling it then what's the stop someone evil from just going in and say adding a thousand coins to their own account?

Well, fortunately for the network they are unable to do that because these primary validators are going to be constantly monitored by the third and last type of node in the network called the confirmation validators.

The Confirmation validators

confirmation validators are going to be constantly checking the primary validators results.

You can think of it like checking the primary validators homework.

After checking those results of the transactions they are going to report that information back to the banks so essentially if this primary validator ever tried to cheat and say "oh uh plus 100 coins to me", this confirmation validator is going to look at this transaction and say "wait this isn't legit, no, bank this primary validator was lying".

In the other case where it says "okay, Bucky paid Sally 8 coins, so we'll say +8 for Sally, and the primary validator validated correctly", then the confirmation validator is going to look at this and say "yes i calculated this exact same thing independently and I reached the exact same conclusion once I validated the original transaction, therefore you must be telling the truth" so the confirmation validator is going to report that back to the bank, and the bank will then stream that down to the sender to say: "the transaction that you sent went through, it got validated". It will also notify Sally, saying : "you received 8 coins from Bucky".

Beautiful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment