DZone
Cloud Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Cloud Zone > The Bitcoin Protocol: How It Works

The Bitcoin Protocol: How It Works

Learn the ins and outs of the world's most popular virtual currency, including how Bitcoin and blockchain work together and how Bitcoins are created.

Douglas Brooks user avatar by
Douglas Brooks
·
Jan. 11, 17 · Cloud Zone · Tutorial
Like (12)
Save
Tweet
22.36K Views

Join the DZone community and get the full member experience.

Join For Free

Bitcoin is a form of digital cash that allows online payments between the buyer and the seller. It works as a digital ledger that records transactions and balances of accounts.

Bitcoins are exchanged using the Bitcoin Protocol built over the principles of cryptography. The protocol defines the procedure that is followed by a Bitcoin transaction from its creation, through validation and final confirmation.

At the core of protocol is the Bitcoin transaction mechanism. Bitcoins are spent from electronic Bitcoin Wallets and are exchanged using Bitcoin transactions. In order to understand the protocol, let us first try to understand a transaction, the information it contains and how this information is processed.

Bitcoin Transactions

A Bitcoin transaction essentially contains the following information:

  • ID: Unique transaction ID which is the SHA256 double-hash of the transaction data.
  • Input: The bitcoin addresses that identify the sources of the bitcoins to be transferred. These are usually a previous transaction’s output and are used to verify the sender and check the available balance.
  • Amount: The number of bitcoins to be transferred.
  • Output: The receiver’s bitcoin address. In cases where there is leftover bitcoin change, the output should also include an entry for the sender’s address to send it back, to be collected as “Transaction Fee" or to be sent to another receiver.

Outputs from one transaction can be used as inputs for another transaction. This creates a chain of ownership as the bitcoin value is moved from address to address.

Image titleFigure 1: Bitcoin Transaction Chain

Transaction Validation

All digital cash transactions also need to be checked and verified for authenticity, duplicity, and cash availability. The validation of the transactions is not centralized and all participating nodes are authorized for it.

A Bitcoin Wallet account that initiates a payment transaction is identified by a Bitcoin address and a pair of public and private keys. To enable verification of the sender identity, transactions are digitally signed using the sender’s private key and validated using his public key that is available to all the nodes.

The Bitcoin system orders the transactions into lists called blocks. These are subsequently linked to form a blockchain, a shared public ledger of all confirmed transactions. Transactions not yet included in the blockchain are unconfirmed and reversible.

The miners confirm and write these transactions into the blockchain. To prevent double-spending, a transaction is not marked confirmed until it has received a certain number of confirmations.

Each bitcoin mining node keeps a personal copy of the BlockChain which is updated whenever a new transaction arrives. This article explained that GPU is also a very efficient tool for the speedy mining of bitcoins. Subsequently, it also tries to validate the current and previous transactions in the block by solving a mathematical puzzle called the Proof of Work. The successful node that solves the puzzle gets a Bitcoin reward and its BlockChain approved and accepted by all nodes.

The Bitcoin Protocol

In terms of the transaction creation and validation process, the Bitcoin Protocol can be stated as below:

  • A new transaction is broadcast to all participating nodes in the network.
  • Each node collects new transactions into a block.
  • Each node tries to validate the new transaction and all previous ones by finding a solution to the Proof of Work for the block.
  • The node which finds the solution broadcasts the solved block to the network.
  • Nodes validate the transactions in the block and accept the block.
  • Nodes start working on the next block. A hash of the last accepted block is created and used as a reference in the next block.

Summary

The Bitcoin protocol is based on collaboratively maintaining the Bitcoin ledger. The digital cash is transferred through transactions which are confirmed only after validation of key criteria and joint consensus by participating nodes through a mathematical puzzle based voting process.

Bitcoin Protocol (object-oriented programming) Blocks

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Getting Started Building on the NEAR Network with Infura
  • Getting Started With RSocket Kotlin
  • What Is xAPI: All You Need to Know to Get Started
  • How to Gain Competitive Advantage in Software Development With Innovative Technology?

Comments

Cloud Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo