Coder Social home page Coder Social logo

zilong-dai / bitcoin-tx-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chaincodelabs/bitcoin-tx-tutorial

0.0 0.0 0.0 8 MB

A technical tutorial for understanding how bitcoin transactions are created and signed

Python 4.72% Jupyter Notebook 95.28%

bitcoin-tx-tutorial's Introduction

bitcoin-tx-tutorial

This repo contains a series of python jupyter-notebooks to explain how bitcoin transactions are created and signed. The notebooks will start up an instance of bitcoind in regtest mode so that transactions can be validated and broadcasted on regtest. Each notebook has some questions and exercises to test your understanding.

Prerequisite knowledge

Chapters

Setup

Python3

This project requires Python 3.6 (or greater) to be installed on your machine already. All other dependencies will be installed automatically with pip3.

To verify your Python version, run

python3 --version

If it is properly installed, you should see something like:

Python 3.9.13

To copy the repository to your local machine, it is recommended to use git but alternatively you can also download the files directly from GitHub, there are no further dependencies on git.

git clone https://github.com/DariusParvin/bitcoin-tx-tutorial
cd bitcoin-tx-tutorial

To create a virtual environment and install all dependencies:

python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt

Finally, to launch the interactive notebook:

jupyter notebook

Bitcoin core

The notebooks in this repo use bitcoin core's TestShell from its test framework. The TestShell is used to create a local test instance of a bitcoin node (and blockchain) against which we can test our manually created transactions. The notebooks in this repo have been tested with bitcoin core v24.0.1.

Useful resources

  • bitcoin-tx-color-coder: A tool for decoding raw transactions. It color-codes and interprets the bytes, similar to the examples in this tutorial.
  • BitcoinIDE: Allows testing of Bitcoin stack operations and script analysis. Useful for understanding script evaluations.

Acknowledgements

bitcoin-tx-tutorial's People

Contributors

dariusparvin avatar amitiuttarwar avatar gimballock avatar stickies-v avatar impa10r avatar jrakibi avatar itorouk 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.