Skip to content

This project implements a basic blockchain using C++. It consists of Block and Blockchain classes, where each block contains an index, data, timestamp, previous hash, and a SHA-256 hash. The blockchain chain starts with a genesis block and new blocks are added to form a decentralized ledger.

Notifications You must be signed in to change notification settings

AryanKaji/Simple_Blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Simple C++ Blockchain

This project is a basic implementation of a blockchain in C++, demonstrating core blockchain principles such as data immutability, chaining via cryptographic hashes, and timestamping using SHA-256 (via OpenSSL).

Features

  • Creates a blockchain starting with a genesis block.
  • Each block contains:
    • An index
    • Timestamp
    • Data
    • Previous block's hash
    • Its own current hash
  • SHA-256 hashing is performed using OpenSSL.
  • Outputs the entire blockchain to the console.

Requirements

  • C++ compiler (e.g., g++, clang++)
  • OpenSSL library installed
  • Windows users: Ensure MinGW/MSYS2 is configured with OpenSSL support

How to Build

Windows (MSYS2 example):

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

About

This project implements a basic blockchain using C++. It consists of Block and Blockchain classes, where each block contains an index, data, timestamp, previous hash, and a SHA-256 hash. The blockchain chain starts with a genesis block and new blocks are added to form a decentralized ledger.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages