Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 4.05 KB

README.md

File metadata and controls

80 lines (55 loc) · 4.05 KB

logo

The Crypto Project

This is a blockchain project that implements some of the major feature of popular cryptocurrency project like Bitcoin and ethereum using go programming language. This an experimental project for learning purposes and it contains detailed overview of how blockchain works, most importantly how this project works. You can checkout references to some major materials that plays important roles in making this project happen.

High-level Flow Diagram

PereQuisite

Terms

  • Blockchain
  • Consensus, Blocks & Proof Of Work (POW)
  • Wallet
  • Transactions
  • Uspent Transaction Output (UTXO)
  • Merkle Tree
  • Networking (P2P/Distributed System)

Repository Contents

Folder Contents
./p2p Scripts for the crypto project nNetwork Layer
./Binaries An on-demand Folder for executable E.G Wallet
./cli CLI Scripts for interacting with the blockhain
./api Source code.

Blockchain

Interacting with the blockchain

  • Via CLI

  • REStFul API

Consensus, Blocks & Proof Of Work (POW)

Wallet

The wallet system, comparable to a bank account, contains a pair of public and private cryptographic keys. The keys can be used to track ownership, receive or spend cryptocurrencies. A public key allows for other wallets to make payments to the wallet's address, whereas a private key enables the spending of cryptocurrency from that address.

NB: you can't spend your digital currency without your private key and once your private key is compromise, moving your money to a new wallet address is the best thing to do.

Transactions

Uspent Transaction Output (UTXO) Model

This concept is became really popualr due to the bitcoin blockhain which is defined as an output of a blockchain transaction that has not been spent They are available to be used in new transactions (as long as you can unlock them with your private key), which makes them useful. UTXOs is used as inputs when a user tries to send X amount of token to Y person given that the amount of UTXOs that the user can unlock is enough to be used as an input. Calculating a wallet address balance can be gotten by accumulating all the unspent transaction outputs that are locked to the particular address

Why do we need this ?

Blockchain data are quite verbose, it can range from hundrends to billions of data and computing user wallet balance from a blockchian of that size is computationally expensive in which UTXOs came in as a resucue to reduce overhead. UTXOs ain't all that clever but it's a progress, Ethereum introduced a better way to compute user balance which i think is way better than UTXOs.

How it works

UTXos are stored on BadgerDB and specific commands were provided to handle this but Note, UTXos are created from the blockchain

Merkle Tree

Networking (P2P/Distributed System)

TODO

  • Data visualization
  • Node visualization
  • gRPC implementation for accessing blockchain data
  • Smart Contract & VM (Maybe, 😃)

References