Getting Started with Bitcoin and Bitcoin NG

Aryan Garg Last Updated : 11 Jan, 2023
6 min read

This article was published as a part of the Data Science Blogathon.

Introduction

Bitcoin is a type of cryptocurrency used in the transaction of payments. Satoshi Nakamoto first introduced it in 2008.

Bitcoin is a decentralized peer-to-peer online currency, meaning it is not subject to any central authority, like a central bank or government. Transactions are verified by massive computing power and recorded in a publicly visible blockchain. Bitcoins are created as a reward for a process known as mining and can be exchanged for other currencies, products, and services. Bitcoin is often called the first cryptocurrency, although there have been other attempts at creating digital cash.

Bitcoin is different from traditional currencies because it is decentralized, meaning no central authority or government controls it. Transactions are verified by a network of computers and recorded in a public ledger called the blockchain.

Source – capital.com

Applications of Bitcoin

Bitcoin transactions are fast, inexpensive, and secure. We can use Bitcoin to pay for goods and services online or in person. We can also use Bitcoin to send and receive money across borders without needing a bank or other financial institution.

There are three main types of Bitcoin transactions:
1. Sending Bitcoin to another person
2. Buying goods or services with Bitcoin
3. Exchanging Bitcoin for another currency

Sending Bitcoin to another person is the most common type of transaction. To do this, you need the other person’s Bitcoin address. It is a unique string of characters that identifies their Bitcoin wallet. You can find someone’s Bitcoin address by asking them for it or by looking it up on a Bitcoin blockchain explorer.

Once you have the recipient’s Bitcoin address, you can enter it into your wallet and choose how much you want to send. Most Bitcoin wallets will then calculate the appropriate fee to send the transaction. This fee goes to the miner who mines your transaction in the main blockchain.

It allows for a more open and transparent financial system that is not subject to the whims of central authorities.

Working of Bitcoin

The working principle of Bitcoin is quite simple. When someone sends a Bitcoin to another person, the transaction is verified by computers worldwide. Each computer that verifies the transaction completes a mathematical operation, and the more computers that verify the transaction, the more secure it becomes. Once the transaction is verified, it is recorded in a publicly available blockchain. Bitcoin transactions are not anonymous, but they are pseudonymous.

The public-private key is used in Bitcoin to ensure that only the private key owner can spend the Bitcoin associated with the public key. The owner keeps the private key secret while the public key is shared with the entire network.

Public-private key cryptography is a cornerstone of the Bitcoin system. In a nutshell, it allows two parties to communicate securely without sharing personal information.

The public-private key cryptography is based on the mathematical principle of symmetric-key cryptography. In symmetric-key cryptography, the same key is used to encrypt and decrypt the data.

The sender keeps the private key secret and is only used to encrypt the data. The public key is made publicly available, so anyone can encrypt the data using the public key. The receiver can then decrypt the data using the private key.

Bitcoin Mining | Bitcoin NG

Basic Algorithm for Bitcoin:
The below algorithm is the pseudo-code to mine a block in bitcoin using Proof-of-Work(PoW) consensus method.

In this code, we will calculate the hash value by changing the nonce until we reach the given difficulty level. In this algorithm, there are no constraints on the node. Any node in the network can solve the mathematical problem and get rewards.

def LEADER_BITCOIN(Node,i,transaction)
    nonce <— 0;
    hash <— null ;
    while hash > difficulty do
        nonce < nonce+1;
        hash<—calculatehash(transaction,nonce);
end

Value of Bitcoin

When it comes to Bitcoin, there are a few factors that can affect the value of this digital currency. Below, we outline a few of these factors:

1. The first and most important factor is the amount of Bitcoin that’s in circulation. The fewer Bitcoin there are, the higher each one is worth. This is because there’s more demand for Bitcoin, but the supply is limited.

2. Another significant factor is the number of businesses and organizations that accept Bitcoin as payment. The more companies accept Bitcoin, the more popular it becomes. This increases the demand for Bitcoin, which drives up the price.

3. Another essential factor is the news. If there’s positive news about Bitcoin, such as more businesses accepting it, this can drive up the price. On the other hand, negative news, such as a hack of a prominent Bitcoin exchange, can cause the price to drop.

There is also a dedicated formula to which we can relate the supply and demand of bitcoin. But first, understand the below parameters.

T: Total bitcoin transaction/second
D: Duration that a BTC needed by a transaction
S: Supply of the bitcoin
P: Price of the bitcoin

We have,
S/D = Bitcoins available per Second
T/P = Bitcoins needed per Second

According to the demand-supply rule, when the supply of bitcoin increases, demand decreases consequently, the price will also decrease. And when the demand increases, the supply of bitcoin will also decrease. Consequently, the price of the bitcoin will also increase.

At an equilibrium state, the supply, S over D, equals the demand, T over P.

We can deduce the price P as,
S/D=T/P

At the Equilibrium state,
P=TD/S

This is the fundamental equation to calculate the bitcoin exchange rate.

Improvised/Modified Bitcoin:
In a nutshell, Modified Bitcoin is a Bitcoin fork that occurred on August 1st, 2017. This fork was created to help improve the scalability of Bitcoin by increasing the block size limit to 8MB. This larger block size limit allows more transactions to be processed on the Bitcoin network, which helps reduce fees and speed up transaction times.

Bitcoin NG

Bitcoin NG is a new consensus protocol for the Bitcoin blockchain that aims to improve upon the current protocol known as Bitcoin. NG stands for “next generation,” and the protocol is designed to address some of the limitations of the current protocol, such as its slow transaction speed and lack of scalability.

Bitcoin NG is a next-generation blockchain protocol that provides several advantages over the existing Bitcoin protocol.

It enables faster transaction speeds and improved scalability by increasing the block size limit and allowing for more transactions to be processed per block.

It also introduces a new consensus mechanism based on the leader selection approach. Under the Bitcoin NG protocol, a designated leader is responsible for creating new blocks. The network chooses the leader based on several factors, including total mining power, network latency, and block propagation time.

The leader selection process is designed to incentivize miners to propagate blocks quickly and efficiently. If a miner propagates a block slowly, it may be removed from the leader pool and replaced with a more efficient miner. This should reduce the risk of a network fork, as blocks will be propagated more quickly and evenly throughout the network.

Overall, the leader selection process in Bitcoin NG is designed to improve upon Bitcoin’s scalability issues by incentivizing miners to propagate blocks quickly and efficiently.

This protocol is best suitable for IoT devices, as it is low-powered and can work in resource-constrained environments.

The basic algorithm for Bitcoin NG:
The below algorithm is the pseudo-code to mine a block in Bitcoin NG using the Leader Selection method.

In this code, we will do the same work as in bitcoin. But in this case, all the nodes are not allowed to mine the block. Only the node, which is a leader, has been allowed to mine the block. This saves a lot of computational power and time in the mining process.

def LEADER_NG(Node, i, leader, transaction)
    nonce <— 0 ;
    hash <— null ;
    if leader!=i then
        while hash > difficulty do
            nonce < nonce+1;
            hash <— calculatehash(transaction,nonce);
        end
        return Node[i];
    end
Bitcoin NG
Fig. – Difference between Bitcoin and Bitcoin NG

Conclusion

In this article, we have understood the fundamental difference between Bitcoin and Bitcoin NG and the working of the Bitcoin Protocol. Other than Bitcoin and Bitcoin NG, there are a bunch of different protocols for solving specific problems having their consensus algorithms. For example, you have heard of these two famous Ethereum and Hyperledger Fabric protocols. Both of these two protocols are made to solve a particular problem. Ethereum widens the scope of blockchain technology through Smart Contracts, while Hyperledger Fabric provides highly private networks that work on an industrial scale.

You can read more about them in my other articles. Please check them out too.
How to Get Started with Ethereum Network?
Introduction to HyperLedger Fabric in Blockchain Network

There are other protocols, like IOTA, Steller, and Ripple, which we will discuss in the upcoming articles.

Key takeaways of this article:
1. First, we discussed the Bitcoin protocol and then understood its primary use cases.
2. Then, we discussed the working of Bitcoin and how we can calculate its market value.
3. Finally, we discussed the Bitcoin NG protocol and concluded the article.

That’s all for now. I trust you liked reading the post. Please feel free to comment below if you have any questions or ideas. You may also add me as a connection on LinkedIn. It will make me very happy to work with you.

Do check out my other articles also.

The media shown in this article is not owned by Analytics Vidhya and is used at the Author’s discretion. 

I am currently pursuing my Bachelor of Technology (B.Tech.) in Electrical Engineering and Engineering from the Indian Institute of Technology Jodhpur(IITJ). I am very enthusiastic about Machine learning, and Software Development. Feel free to connect with me on Linkedin.

Responses From Readers

Clear

We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.

Show details