Skip to content

Files

Latest commit

dfc65cb Β· Jun 3, 2021

History

History
53 lines (33 loc) Β· 1.7 KB

readme.md

File metadata and controls

53 lines (33 loc) Β· 1.7 KB

iCoin πŸͺ™

This code explains the working of Crypto-currency.

Code Requirements πŸ¦„

The example code is in Python (version 2.7 or higher will work).

  1. import hashlib
  2. import flask

Description πŸ’°

A cryptocurrency (or crypto currency) is a digital asset designed to work as a medium of exchange using cryptography to secure the transactions and to control the creation of additional units of the currency. Cryptocurrencies are classified as a subset of digital currencies and are also classified as a subset of alternative currencies and virtual currencies.

Concepts πŸ‘¨β€πŸ”¬

  1. Proof-of-Work Algorithm
  2. Concensus Algorithm

For more information, see

Setup πŸ–₯️

  1. After you have set up the python code, you need to send a POST request of transferring iCoins to someone.
curl "localhost:5000/request_transaction" \
     -H "Content-Type: application/json" \
     -d '{"from": "Akshay", "to":"Raghav", "amount": 10}'
	 
  1. Now mine the block for verification by send a GET request.
curl localhost:5000/mine
	 
  1. You can check all the blocks by sending a GET request.
curl localhost:5000/blocks
	 

Execution πŸ‰

To run the code, type python iCoin.py

python iCoin.py