A Blockchain ruby app to keep track of OreoCoin Cryptocurrency transactions ( or anY type of data you want ) this project is bassed on Creating a blockchain with Javascript tutorial, and I translated it to ruby to practice both languages.
In simple words, block is an object that stores mainly three things
Data
=> Any data you want to store for example: atransaction
- Its
Hash
=> a digital fingerprint - Previous block's
Hash
=> previous block finger print
- Easy : Blockchain is a system of recording information in a way that makes it difficult or impossible to change, hack, or cheat the system.
- Hard : A blockchain is a decentralized, distributed, and oftentimes public, digital ledger consisting of records called blocks that is used to record any type of data (the most famous appliction is cryptocurrency transactions)
- Video explanation
- Clone the repo
git clone https://github.com/od-c0d3r/blockchain-ruby.git
- Run
bundle install
to install dependencies. - Run
ruby main.rb
on project root
- Blockchain class
Add auto id counter for adding block to the chain- Verify blockchain (to prevent tampering)
- Simple proof-of-work algorithm
- Generate wallet (private/public key)
- Sign transactions