Giter VIP home page Giter VIP logo

bitcoin_transaction_verification_system's Introduction

Bitcoin Transaction Verification System

About

This program is mainly focused on the various scripts that verifies is a particular transaction from he mempool folder is valid, if valid it is added to a batch of transactions that are to be mined as a block and added to the blockchain. In summary, it is a basic implementation of the Bitcoin mining process.

Key Functionalities

1. Transaction Validation with the various scripts

Scripts Implementation Status
P2PK 0
P2PKH 1
P2MS 0
P2SH 0
P2WPKH 0
P2WSH 0
0 = Has not been implemented , 1 = has been implemented

2. Block Mining Proocess

This takes a collection of the valid transactions and try to create a block from them to add to the blockchain, the below approach is taken for this process.

  • Transaction Hashing:
    Each individual transaction is hashed using a cryptographic hash function, typically SHA-256 (Secure Hash Algorithm 256-bit). The transaction data, including the inputs, outputs, and other metadata, is serialized into a byte stream. This byte stream is then passed through the SHA-256 hash function, producing a fixed-size 256-bit (32-byte) hash value, often referred to as the transaction ID (txid).

  • Merkle Tree Construction:
    All the transaction IDs (hashes) in a block are combined into a Merkle Tree data structure. A Merkle Tree is a binary tree where every non-leaf node is the hash of its two child nodes. The leaf nodes of the Merkle Tree are the transaction IDs. The hashes of the transactions are combined in pairs, and the hash of each pair is calculated using a hash function (typically SHA-256 again). This process continues up the tree, creating parent nodes by hashing pairs of child nodes, until a single root hash is obtained, known as the Merkle Root.

  • Block Header Construction:
    The Merkle Root is included in the block header, along with other metadata such as the previous block hash, timestamp, nonce, and difficulty target. The block header is serialized into a byte stream.

  • Block Hashing: The serialized block header is passed through a double SHA-256 hash function (SHA-256 applied twice). The resulting 256-bit (32-byte) hash value is the block hash or block ID.

Contributors

responsible for blockchain validation automation with Github actions
https://github.com/theanmolsharma
https://github.com/adi-shankara

Reference

bitcoin_transaction_verification_system's People

Contributors

obamwonyi avatar theanmolsharma avatar adi-shankara avatar github-classroom[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.