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.
- 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
- C++11 or later
- OpenSSL (for SHA-256)
To compile the code, ensure OpenSSL is installed, then use:
g++ blockchain.cpp -o blockchain -lssl -lcrypto
Mining time may vary based on the system and difficulty level.