Skip to content

Latest commit

 

History

History
153 lines (105 loc) · 13.9 KB

L2.1 Blockchain Data Overview.md

File metadata and controls

153 lines (105 loc) · 13.9 KB

L 2.1 Blockchain Data Overview

Blockchain vs Traditional Databases

Traditional Database Characteristics

Blockchain Characteristics

Blockchain do not allow user to delete data. Rather than deleting or overriding all data, blockchains creates a new record.

Immutable Data Data that cannot be updated after being added to the database.

Blockchain maintains a permanent historical record of all transactions that have happened on the network.

Do You Need a Blockchain

Blockchain Questions Overview

If the answers for all the questions are Yes, then you need a Blockchain.

Blockchain Types

Blockchain Types Overview

3 Types:

  • Public Blockchain
  • Private Blockchain
  • Hybrid Blockchain

Public Blockchain On a public blockchain, everything is open for the entire network. Anyone can join and get access to add and verify transaction. Bitcoin is an example of public Blockchain.

Private Blockchain A private blockchain is basically the opposite of a public blockchain. You get the functionality of a blockchain, but still have the ability to restrict who can join the network. Rather than anyone being able to join and verify on the network, you can explicitly assign those permissions to specific users.

Hybrid Blockchain A Hybrid Blockchain is a mix of both a public and private blockchain. In a Hybrid blockchain, transactions stay private while allowing a network of users to create and validate transactions. Owners of the blockchain, can determine which transactions should only be visible to certain smaller groups and which can remain public.

Each of the blockchain, using the same encrypted data using wallets and keys like we’re spoken about previously. Where the differ is in how much you have the ability to restrict access to this data. Public blockchains allow open access to all the data in the network and allow anyone to become a node in that network. Private blockchain do the complete opposite and restrict this data to only specify users. Finally, Hybrid Blockchains are a mixture of these two types that allow you to restrict some information while allowing other information to remain public.

Choose a Blockchain Type

Will transactions be public? Public Blockchain

Will other companies need access to your data? Private Blockchain

Should some information be public while other information is restricted? Hybrid Blockchain

P2P Network vs Client-Server Model

P2P Networks vs Client-Server Model Overview

Client-Server Model Application structure that breaks up takes between service providers (servers) and service requesters (clients). A server is a centralized resource that contains the information that users want to access. The client makes a request to the server and the server repoints with the information the client needs. There are different types of servers depending on the situation. Web servers serve websites and file servers serve computer files. We can say, anything that provides any server like food or beverages is a server, and anything they served, is a client. A client server infrastructure can contain many separate servers, but these servers are owned by a single authority.

Peer-toPeer Network Network of computers that share access to files with each other. In P2P networks, every node is both the server and the client. They both hold information that others can access and can request information form others. The P2P model allows us to have distributed and decentralized networks rather than centralized networks like in a client-server model.

There’s one important thing to know as a potential problem of P2P networks in the case of Bitcoin and other proof-of-work blockchains. If you have access to more computing power, you can allocate more resources to mining and get more rewards for your effort. This gives you more money to buy more computers and get even more rewards. This cycle has caused problems for P2P networks using proof-of-work. The larger miners keep buying more resources, getting larger and larger and this centralizes all the work happening to just a few nodes. Centralizing the power and information defeats the purpose of a distributed network and is a major reason why the blockchain is turning to solutions outside of proof-of-work.

P2P Network vs Client-Server Model

Infrastructure The client-server model is generally a centralized model. While it’s network may contain many servers, they’re usually owned by a single corporation. This is different that a p2p network, the p2p network is distributed across all the users in the network. Each of these users, known as nodes, are responsible for acting as both the clients and the servers.

Cost For the Client-Server model, you need to have a significant enough amount of availability to serve all the requests you’re receiving. It’s on you to make sure they’re accounting for all of this and have the appropriate resources needed to keep things up and running. With a p2p, the load is distributed across all the nodes that join the network. You can join a p2p right now using your local computer. The cost of all the local computers being used to support the network can definitely add up to be very expensive. But in this case, both the load and the cost of the network is being distributed across each of the nodes.

Control In a Client-Server network, the central authority that serving the information has the authority to do whatever they like with it. If YouTube doesn’t want a video shown, they can delete it. In a p2p network, no one has the ability to do either of these things. Everything on the network is owned and shared by everyone. You can choose to leave the network, if you like, but you can’t be blocked deleted or removed by a central authority.

Security For this comparison, we’re focusing specifically on security as it relates to how easily someone can access the information on a network. Since the client-server model is run by a central authority with the ability to control permissions across the network, it’s generally considered to be much more secure. In the p2p networks, nodes are free to share data across the network and any users will have access to this data. As we’ve seen on the blockchain, this can vary between public, private and hybrid blockchains. It’s important to note that just because peer to peer isn’t as secure as the client server model, that doesn’t mean that the blockchain isn’t secure. That’s because the p2p network itself isn’t what’s contributing to the security of the blockchain. The blockchain security comes from using private keys, public keys, wallet addresses, and cryptography. These security measures have all been added into compensate for the fact that a p2p alone doesn’t guarantee security, it just distributes the control.

Stability Overall, a client-server model is generally considered more stable. That’s because the central owner can add or remove computation and storage more easily to meet the demands of the clients. A p2p network is generally less stable, especially when it’s getting started. By depending on users to serve up information, you’re placing your stability in their hands. If there are only five peers in the network, and three of them leave or the computer break, you just lost 60 percent of your network’s power. Instability goes down as more nodes are added to the network. If your network now has 1,000 nodes, those same three nodes could crash but it wouldn’t have as much impact.

Explore Blockchain Data

Explore Blockchain Data with a Block Explorer

Blocks contain two main sections that each hold important data. The first section is the block header. The block header contains metadata about the block including things like the hash value which allows to connect blocks into a chain. The second section is the body of the block. The body contains all of the blocks transaction information. Using BlockExplorer to see how a transaction consist of.

Explore Blockchain JSON Data

BIPs and Forks

Bitcoin Improvement Proposals

Bitcoin Improvement Proposals Technical Documents used to issue changes to the bitcoin core client.

Bitcoin BIPS on GitHub, those BIPs are made by community members who believe they can improve the protocol. They’re sent out to the network and published publicly. At this point, the proposal is only a suggestion for an improvement. Before being implemented, the proposal needs to go through a voting process. This vote is taken by the miners in the Bitcoin network. If the proposal gets a majority vote from the miners, it';

This means the miners actually have control over the implementation of updates to the network. Miners are a good choice for this because they’re invested in the improvement of the protocol. Once the vote is taken, the proposal is either accepted or denied. If accepted, it’s time to start implementing the proposed changes into the software.

Hardforks

There are different types of forks that can happen based on how a Bitcoin Improvement Proposal is implemented. The different types of forks are hardforks, softforks, and source code forks. Hardfork Large change to the bitcoin protocol. It’s a permanent change to the software that conflicts with the existing version resulting in an entirely new software. Once a Hard Fork is implemented, it creates an entirely separate network. Users will need to choose if they want to stick with the current network or choose the new one. This happens because of how the change occurs. In a Hard Fork, software developer create an exact copy of the entire Blockchain protocol. They can do this because the codebase for most blockchains are completely open source. Once the developers make this copy, they write their new code into the software. Next, they need to decide when this change will take place. The way they do this is by specifying a block number. For example, “Once we reach block 100 our changes will be implemented.” At this point, some nodes continue with the original version and others transition to the alternative version. They show their support of the version they chose by adding blocks only to this new chain. Since each blockchain is now building a different history, they’re no longer compatible. Even though they’re now operating separately, they still have a shared history from before the fork. That means that all transactions that happened before the fork are valid on both chains.

Bitcoin Cash, is an upgrade to the size of a block resulted in a hardfork. Some developers wanted to double the current block size and others wanted to make it even larger. When they couldn’t come to an agreement, some developers went with an increased size and other stayed with the current block size. That’s why we now have Bitcoin and Bitcoin Cash.

Softforks

Softfork Small change to the blockchain protocol. This change makes it said that the updated version is still compatible with the original software.

In a soft fork, there’s no permanent split in the chain. There may be a temporary split, but that’s only to allow time for the changes to propagate through the network. Once everyone has upgraded to the updated protocol, the updated version of the network will be the only one that exists.

Segregated Witness (Segwit) An example of a soft fork is an improvement known as Segwit. Softfork of Bitcoin to increase the block size limit. It was a soft fork of Bitcoin meant to increase the amount of space available in each block. It allows a block to hold more transactions by removing the signature data from each transaction. Without this signature data, each transaction takes up less space which allows more of them to fit in each block. It’s separating or segregating, the witness which is the signature data from the transaction.

Source Code Forks

Source Code Forks Copy of blockchain code base with no resulting connection to the original blockchain. It is the term used for copying the entire codebase of an existing project to a new project.

Litecoin Source code fork of bitcoin that resulted in an alternative currency. With Litecoin, they copied the Bitcoin code base, implemented their changes, and created an entirely new blockchain with no association to Bitcoin. The currency now trades as a completely separate alternative to Bitcoin.