Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Ripple Quick Start Guide

You're reading from   Ripple Quick Start Guide Get started with XRP and develop applications on Ripple's blockchain

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher Packt
ISBN-13 9781789532197
Length 160 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Febin John James Febin John James
Author Profile Icon Febin John James
Febin John James
Arrow right icon
View More author details
Toc

Introduction to blockchain

The word blockchain itself is descriptive. Here, blocks of digital information are linked back to one another like a chain of blocks. In the following image, we can see blocks that contain a series of transactions:

If someone tampers with the first transaction of the second block by altering $300 to $3,000, Ashin's balance would have an additional $2,700. Such tampering would lead to disastrous consequences. Hence, blockchain uses cryptography to make itself tamper-proof.

In the following blocks, we have added an additional attribute, the hash:

A hash is a set of characters that represents the contents of the block. It's calculated using a cryptographic hash function. For the sake of simplicity, we have made a simple hash by taking the first letters from the names of senders and beneficiaries. We also added the amount transferred in the middle of those first letters, and hence the hash for the first block is J500JJ450A. (Technically, this is not how a hash function works, but you get the idea.)

Since the first block has no preceding block, its previous hash field is not applicable. However, from the second block, all successive blocks have stored the hash of its previous block.

If someone tries to tamper with the first block and change John's transfer from $500 to $5,000, the hash of that block changes from J500JJ450A to J5000JJ450A. However, the successive block has already stored the hash as J500JJ450A. This mismatch would break the chain. Hence, the purpose of the hash is to ensure that blocks are not tampered with.

What if someone tries to change a block and the hash of all the succeeding blocks?

Different blockchains have different mechanisms to protect themselves from such situations. In the Bitcoin system, before a block is added to the chain, certain computationally intense tasks must be carried out.

Blocks are only confirmed once proof of running such intensive tasks or proof-of-work is shown. Hence, if a hacker wants to modify the hashes of n blocks, they need to run such computationally intense tasks n times to show the proof-of-work. Considering the present limits in computation, this scenario are highly unlikely.

Secondly, blockchain systems are decentralized. This means that a blockchain program isn't executed by a single computer, but all the computers in its network work collectively in executing its instructions. The data in the blockchain is also replicated in all the computers present in the network. Hence, the system would consider only what the majority say is correct.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime