Coder Social home page Coder Social logo

utxo_dump_tools's Introduction

UTXO dump tools

This repository contains various converting and processing tools for dumps of the Bitcoin UTXO set, as generated by Bitcoin Core via the dumptxoutset RPC. It was created in the course of reviewing and testing pull request #24952 (bitcoin/bitcoin#24952), which adds a new option to dump the UTXO set in SQLite database format.

Overview of tools

utxo_to_sqlite

utxo_to_sqlite is a simple tool for converting a compact-serialized UTXO set to a SQLite database. A table utxos is created with the following schema (matching PR #24952):

CREATE TABLE utxos(txid TEXT, vout INT, value INT, coinbase INT, height INT, scriptpubkey TEXT)

First, let bitcoind create the compact-serialized UTXO set dump:

$ bitcoin-cli dumptxoutset utxos.dat

Then, run the conversion tool via:

$ cd utxo_to_sqlite
$ go run utxo_to_sqlite ~/.bitcoin/utxos.dat ./utxos.sqlite

Note that the first run likely takes longer, as golang has to fetch and build the SQLite library (https://github.com/mattn/go-sqlite3) first.

calc_utxo_hash

calc_utxo_hash calculates the UTXO set hash of a dump in SQLite format. Right now only the MuHash type is supported, which can be determined on the Bitcoin Core node via the gettxoutsetinfo RPC (pass "muhash" as first parameter).

Run via:

$ cd calc_utxo_hash
$ go run calc_utxo_hash ./utxos.sqlite

TODO

  • support also calculating the compact-serialized hash

Acknowledgment

This work has been supported by a Brink grant (https://brink.dev/).

utxo_dump_tools's People

Contributors

thestack 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.