DEV Community

Romeo Agbor Peter
Romeo Agbor Peter

Posted on • Originally published at getrevue.co

Introduction to Blockchain: Part 2

Blockchain as Peer-to-peer System.

A peer-to-peer is a distributed software architecture that allows connection, interaction and execution of tasks with other computer systems running the same software. In the case of uTorrent, you connect with others to download and upload files to and from them. They too can do the same to you and others running the same software. the systems connected act as servers and clients to each other. So, rather than uploading a file to a central file-sharing server (like Google Drive or Dropbox). You just simply upload it directly to a friend’s computer. It takes at least two computers to make it happen, hence the name peer-to-peer (p2p).

FH

The blockchain is a peer-to-peer network with a major difference: the peers in the network must all have a copy of the exact data. Any change made to the data in any of the peers in the network must reflect on other peers. There is a protocol to how changes are made and if a peer modifies its data without following the rules, the change is ignored because it’s invalid. If it happens that your copy of data in the blockchain is erased or becomes invalid, you can request a fresh valid copy from your peers on the network.

In current public blockchains (yes, they are types of blockchains. We’ll get there), data is only ever written and never deleted. Rather than changing data, a new one is attached to the batch or block that forms a chain link (database). Hence the name Blockchain. Besides having access to the same database, each peer in the blockchain has an exclusive right to data that only they can access. In the traditional web, access is granted given a username and a password. In the case of the blockchain, there is no central authority to manage access credentials hence it uses cryptography to grant access. Users on the blockchain are able to generate an ID (referred to as an address) that acts as a locker that is tied to their data and a private key that is used to access the locker. The private key is meant to prove that indeed the user is the creator and owner of the locker. Only the generator of the address alone would have the private key. Furthermore, the private key can not be determined just by obtaining the address.

While users’ data sit publicly on the blockchain, only they can modify it by proving ownership via the private key. Also, a new address can be generated in isolation without it ever clashing with other addresses no matter how numerous they are.
Besides storing static data on the blockchain, it can also store computer codes (executables) that execute at the trigger of an event or at a set time. every peer gets a copy of the program. The Etherium blockchain uses the Solidity programming language to build programs that represent an agreement between two parties (or more). Such programs are called Smart Contracts. The code is marked with its owner’s address. The owner decides the executions that are open to the public and those that only they can execute. Once the code is written it can’t be changed or reversed. Everyone has a copy and can see what it’s doing but can’t interact or alter the code.

Conclusion

So there you have it… next time you hear the news or see on social media talking about a “p2p exchange,” just know that it’s referring to the blockchain as peer-to-peer (p2p) for cryptocurrency.

As noted before, p2p networks existed before blockchain technology. It’s just an ideal adoption for the implementation of the blockchain – which functions differently from traditional p2p networks.

Next, We’ll look into the Motivation for Blockchain as an Information Technology system.

cheers!

Top comments (0)