A package that has a collection of unspent p2wsh bitcoin transactions.

Related tags

Cryptography bitcoin
Overview

P2WSH-UTXO

A package that has a collection of unspent p2wsh transactions. Useful to see what are potential unspent multisig transactions.

Library

Create the P2WSH instance and get a list of UTXOs

let results = UTXOResults::new().results();

Create a UTXO and get an SCID from it

let utxo1 = UTXO {
    id: None,
    block_height: 1,
    block_index: 1,
    transaction_index: 0,
    amount: None,
};

assert_eq!(760542088613330945, utxo1.scid());

Binary

The binary included is used to pull in the datasets and produce json or binary files as a result.

It takes input from two different sources. If I was a smarter person, I would figure out how to parse all of the transactions to get all of the information from a single script.

bitcoin-utxo-dump

Get the current list of all unspent transactions from this tool

I use a fork version with a bunch of continue statements for every non-p2wsh output

then run with :

bitcoin-utxo-dump -f count,txid,vout,height,coinbase,amount,script,type,address
count,txid,vout,height,coinbase,amount,script,type,address
1,d176d4960a78b41971f9d19207b59af6584b16ef323de55e983aec0100000000,2,684110,0,330,0020160d0000000000f0558db21dc3e8d765044120f3b6d18c22f5957ad83382521f,p2wsh,bc1qzcxsqqqqqqq0q4vdkgwu86xhv5zyzg8nkmgccgh4j4adsvuz2g0sjjkeu6
2,d176d4960a78b41971f9d19207b59af6584b16ef323de55e983aec0100000000,3,684110,0,330,00203f52bab5928e8e9388d8fe3c6c536faf8006b97a090501d035ef0eb9136d3868,p2wsh,bc1q8aft4dvj368f8zxclc7xc5m047qqdwt6pyzsr5p4au8tjymd8p5qezmq44
3,d176d4960a78b41971f9d19207b59af6584b16ef323de55e983aec0100000000,4,684110,0,330,00201698e842e20fa57ff8f72e6bf1533138fc0d0f41201b8b959b924ea19a53c809,p2wsh,bc1qz6vwsshzp7jhl78h9e4lz5e38r7q6r6pyqdch9vmjf82rxjneqysjdcsgk
4,d176d4960a78b41971f9d19207b59af6584b16ef323de55e983aec0100000000,5,684110,0,330,002019ae7a5b46cb44f12058461629eebf7b8b300d72f6017367e85ddb26f4c52f03,p2wsh,bc1qrxh85k6xedz0zgzcgctznm4l0w9nqrtj7cqhxelgthdjdax99upsc53hft

bitcoin-iterate

Get a list of transactions and their block height from this tool. This program is needed to look up transaction id and block height since bitcoin-utxo-dump does not do block height.

# ./bitcoin-iterate -q --transaction=%th,%tN --start-hash=0000000000000000015411ca4b35f7b48ecab015b14de5627b647e262ba0ec40 --blockdir=/home/bitcoin/.bitcoin/mainnet/data/blocks > iterate.txt
./bitcoin-iterate -q --output=%th,%bN,%bH,%tN,%oN,%ol,%oa --start-hash=0000000000000000015411ca4b35f7b48ecab015b14de5627b647e262ba0ec40 --blockdir=/home/bitcoin/.bitcoin/mainnet/data/blocks > iterate.txt

example:

4b777745084ef83da587c7278db17f7a33ad5b831b5ee47b18c1c11c6165047c,0
e584dca0c8fe2df700c7c89021ab01de3bcc625b62c6b362a61c02f4c440a624,1
5393e535d9eaf10e8c87dca8f8bd05817dace0911ed25574c8257a21b603f23b,2
b66f62fae63243cc2141765387e51a950d982628cf3396107e743660bb3ec958,3
c977d774b272673f1abd0f4a52832bd8933894346b43a355014dd08a6249bfc7,4
d83894fcecb387d9813e5bdc0e19f2941406a5bd8ca80b27f19aeeb481752111,5
76f8d917a5a47cc3c92f26559c9cb9c3ee0f8027df8d6f0259ab5c65362e9048,6
2dfcb6cfff8ba9ed903f531a70d6443b9373c90868c94180152043aadc217185,7
8ba6d5674193f8f85433e4a85ce7a21b59357adf626ee70fa87355d9a6a9a32a,8
ad48e367144bb9b1cf1d668433268983254e551b4e58bfc3e257f5f7dbe4fb19,9

Merge

Running the binary produces results useful for consumption on their own or part of the library.

The 3rd parameter specifies whether it outputs in json or a small binary file. The 4th is whether to have minimized output parameters (without transaction_id)

cargo run --release utxodump.csv iterate.txt (json/binary) (minimized/full) .

For the curious, the algorithm it runs through is as follows:

p2wsh_map = [string]tx
for row in utxodump.csv
	p2wsh_map[row.txid] = row

for row in iterate.txt
	if p2wsh_map[row.txid]
		save json with row.txid, row.height and found p2wsh info
You might also like...
Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

Fiddi is a command line tool that does the boring and complex process of checking and processing/watching transactions on EVM compatible Blockchain.

hello-world geyser plugin to stream accounts and transactions from a solana node

src/lib.rs: entrypoint src/plugin.rs: main plugin code to run: cargo build && solana-test-validator -r --geyser-plugin-config config.json note: make s

Rust project for working with ETH - Ethereum transactions with Rust on Ganache and also deploy smart contracts :)

Just a test project to work with Ethereum but using Rust. I'm using plain Rust here, not Foundry. In future we will use Foundry. Hope you're already f

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844blobs.

stress4844 Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844 blobs. ca

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer

Tiny CLI for submitting large calldata transactions to EVM networks to stress test the networking layer. Main motivation: EIP4844blobs.

A library facilitating the signing and broadcasting of transactions on Cosmos SDK-based blockchains

txf Transaction factory - a library facilitating the signing and broadcasting of transactions (txs) on Cosmos SDK-based blockchains. How to use Exampl

Like a thread pool, but for signing and broadcasting transactions
Like a thread pool, but for signing and broadcasting transactions

ethers-signer-pool This library provides a utility built on top of the ethers crate. The purpose of the utility is to provide a pool of signers (walle

Mequeue is an executor for MEV bots optimized to be able to process multiple transactions concurrently.

Mequeue Mequeue is an executor for MEV bots optimized to be able to process multiple transactions concurrently. The main goal is to make this executor

Channel some Ki with Lua scripts for sending transactions to Starknet, powered by Rust.

Kipt Kipt is leveraging the simplicity of Lua scripts to manage Starknet contracts using starknet-rs under the hood. With few lines, you can declare,

Owner
Tony Giorgio
Tony Giorgio
This is a solana lite rpc which optimizes sending transactions and confirming transactions strategies.

Solana Lite RPC This project aims to create a lite rpc server which is responsible only for sending and confirming the transactions. The lite-rpc serv

Blockworks Foundation 7 Dec 24, 2022
Minimal Bitcoin wallet intended for teaching rust-bitcoin

Insanely minimal Bitcoin wallet intended for demonstration of Rust Bitcoin ecosystem Absolutely DO NOT use with mainnet funds!!! No privacy - address

Martin Habovštiak 4 May 5, 2023
Modern, lightweight & standard-compliant bitcoin wallet runtime & cli without rust-bitcoin dependencies

Bitcoin protocol command-line wallet & tools Modern, minimalistic & standard-compliant cold wallet from LNP/BP Standards Association. Contributing Con

BP: Bitcoin protocol 3 Jul 31, 2023
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Cossack Labs 1.6k Dec 30, 2022
Silent monero miner using xmrig and has 0% donation.

Note If this reprository is useful to you in in any shape or form please give it a star. Educational purposes only Don't use this project maliciously.

RadonCoding 4 Nov 21, 2022
A Software Development Kit (SDK) for Zero-Knowledge Transactions

Aleo SDK The Aleo SDK is a developer framework to make it simple to create a new account, craft a transaction, and broadcast it to the network. Table

Aleo 270 Jan 5, 2023
Scans the Ethereum network for USDT ERC-20 token transfer transactions

ethscan This is a Rust command line program for scanning the Ethereum blockchain for USDT transfers within a time span and amount span. prerequisites

Frank Buss 4 Oct 6, 2022
Nym provides strong network-level privacy against sophisticated end-to-end attackers, and anonymous transactions using blinded, re-randomizable, decentralized credentials.

The Nym Privacy Platform The platform is composed of multiple Rust crates. Top-level executable binary crates include: nym-mixnode - shuffles Sphinx p

Nym 653 Dec 26, 2022
The Light Protocol program verifies zkSNARK proofs to enable anonymous transactions on Solana.

Light Protocol DISCLAIMER: THIS SOFTWARE IS NOT AUDITED. Do not use in production! Tests cd ./program && cargo test-bpf deposit_should_succeed cd ./pr

null 36 Dec 17, 2022
A tool to help with estimating NEAR gas spent by transactions on Aurora.

Aurora Gas Estimator A tool to help with estimating NEAR gas spent by transactions on Aurora. Building from source Prerequisites Rust GNU Make (3.81+)

Michael Birch 4 Aug 23, 2022