Bitcoin Forum
May 02, 2024, 01:04:49 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: ♤♡Understanding blockchain◇♧  (Read 101 times)
buyexshop (OP)
Copper Member
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
November 03, 2018, 09:38:59 AM
 #1

Blockchain, what is it?



Learning the blockchain at first will cause a little confusion. Just as I was beginning to study this blockchain it was quite confusing. Next, I will give a little reference for friends to start learning blockchain, one of the technologies behind the rapid development of cryptocurrency in the world. Here I will try to discuss this blockchain as easily as possible, because actually blockchain is a simple and simple technology.

introduction

Basically in the activities in the field of technology that is done is processing data, and in processing the data there are many elements - elements in it such as where the data is placed, how the data is created, how the data is distributed and others. As we know at this time every data that we process is decentralized or only stored in one computer which we usually call server. The current system has many disadvantages, one of which is data security is not optimal because the data is only in one place where it makes our data can not be validated data. The other is the problem if there is a system failure from the server then it will make the network down if we don't have a backup, then the data we have is gone.




Blockchain is a technology that is introduced along with Bitcoin by one or a group that calls itself Satoshi Nakamoto, which was originally used to record financial transactions from bitcoin. The simple blockchain is a data structure that cannot be changed, it can only be added. Each data from this blockchain is connected to each other where if there is a change in one of the data blocks it will affect the next data.

With this blockchain, every transaction from bitcoin is stored in an Open Ledger which is distributed into the bitcoin network. Each blockchain will be shared with each computer connected to the network. On each addition of data there will be a check whether the data is valid or not, which is usually called mining or known in other terms Proof of work.


There are several elements in the blockchain, namely data Hash, Block & Proof of work. Next we discuss one by one.

Hash

Before going deeper about this data block I would like to mention the term here which is Hash where Hash is a digital fingerprint or the identity of a digital data. As the following example:

Code:
String data = "Hello World";

log(data.hashCode());
// -862545276

Here we know the digital identity of the Hello World object is -862545276. Each data or digital object on the data block will be hashed with the SHA-256 algorithm. Here's an example:

Code:
String data = "Hello World";
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] bytes = digest.digest(data.getBytes());
String hash = DatatypeConverter.printHexBinary(bytes).toLowerCase();
log(hash);
// a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e

Block

Blockchain itself is a collection of several data blocks where this data block is data from transactions that we make. Or we can define the data in this block ourselves. Which, like this, Blockchain can not only be used to record financial transactions.

In this block, we will also have a digital identity which we will then haveh. Hash here is the identity of the data block that we encrypt with the SHA-256 algorithm. The hash data here will be of two types, namely the hash of the block itself and the hash of the previous block.


Code:
{
    "chain": [
        {
            "index": 0,
            "timestamp": "01/12/2017",
            "data": {
                "amaount": 0.000005RTC
            },
            "prevHash": "0",
            "hash": "bd53895e5f46d62330b1b6143df108bc91133faaf5b046b5ec3379c9a0246e59"
,
            "nonce": 0
        },
        {
            "index": 1,
            "timestamp": "02/12/2017",
            "data": {
                "amaount": 0.000012RTC
            },
            "prevHash": "bd53895e5f46d62330b1b6143df108bc91133faaf5b046b5ec3379c9a0246e59",
            "hash": "0000e814afc9e67c4e8d211ae495773bb8916f84f686642e08a6d42190e24a17",
            "nonce": 179487
        }
    ]
}


In the example above we have two hash data blocks which if the first data changes, then the next hash block data will change which one is this chain form or linkage of this blockchain data.


Proof Of Work


In the process of adding data one that we cannot avoid is spamming and ddos. For that we need to validate each data from each block. POW or Proof of work is a protocol that is used to validate every incoming data that is useful for dealing with spam attacks and ddos ​​attacks.
The usual POW used on the blockchain is to ensure the string "oooo" on each hash of data from each of these blocks. For example, here's the following:


Code:
{
    "index": 1,
    "timestamp": "02/12/2017",
    "data": {
        "amaount": 4
    },
    "prevHash": "bd53895e5f46d62330b1b6143df108bc91133faaf5b046b5ec3379c9a0246e59",
    "hash": "8280412b62d1d5212e269c5f49aed1bd2481b2d00a7be407a7440505800e3eca",
    "nonce": 0
}


We know in the data above the hash data is "8280412b62d1d5212e269c5f49aed1bd2481b2d00a7be407a7440505800e3eca"which here the data has no string "oooo". For that we need to do a calculation process to get a hash value beginning with "oooo" by changing the nonce value. Here is an example function to calculate from the hash:

Code:
public Block mineBlock(){
   while (!setHash().substring(0, 2).equals("00")){
      this.nonce++;
   }
   return this;
}

That way the data that will be entered will be validated first whether it already contains these requirements or not. This way it will take a little time for the calculation process.

Code:
{
    "index": 1,
    "timestamp": "02/12/2017",
    "data": {
        "amaount": 4
    },
    "prevHash": "bd53895e5f46d62330b1b6143df108bc91133faaf5b046b5ec3379c9a0246e59",
    "hash": "0000e814afc9e67c4e8d211ae495773bb8916f84f686642e08a6d42190e24a17",
    "nonce": 179487
}

From the results of calculations that have been done, here are found variables nonce 179487. In the world of bitcoin this process is called mining or coin mining which finds nonce data from each block. On the bitcoin system if we have succeeded in doing the calculation.




Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!