Skip to content

This C++ program demonstrates a basic blockchain implementation using OpenSSL for SHA-256 hashing. Each block stores transaction data, a timestamp, and a nonce. Proof-of-work is used to mine blocks with a difficulty target.

Notifications You must be signed in to change notification settings

AryanKaji/Simple_PoW_Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Simple Blockchain in C++ using OpenSSL

This is a basic implementation of a blockchain system written in C++. It uses SHA-256 hashing via OpenSSL to simulate block creation and proof-of-work mining.


Features

  • Block structure with:
    • Index
    • Timestamp
    • Previous hash
    • Data (transaction info)
    • Nonce
    • Current hash
  • SHA-256 hashing using OpenSSL
  • Proof-of-Work mining with adjustable difficulty
  • Genesis block creation
  • Simple linear blockchain with data immutability

Dependencies

  • C++11 or later
  • OpenSSL (for SHA-256)

Compilation

To compile the code, ensure OpenSSL is installed, then use:

g++ blockchain.cpp -o blockchain -lssl -lcrypto

Note

Mining time may vary based on the system and difficulty level.


About

This C++ program demonstrates a basic blockchain implementation using OpenSSL for SHA-256 hashing. Each block stores transaction data, a timestamp, and a nonce. Proof-of-work is used to mine blocks with a difficulty target.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages