Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
""" THIS CODE IS ONLY EDUCATIONAL - NO | |
PART OF IT IS FIT FOR PRODUCTION USE. | |
NO, SERIOUSLY, I MEAN IT!! | |
As for reading it, start with the `__main__` | |
section at the bottom and go from there. | |
Comments are, deliberately, voluminous. | |
If you want to run the example, just: | |
(a) install Joinmarket (else see the notes on import) |
import bitcointx as btc | |
btc.allow_secp256k1_experimental_modules() | |
btc.select_chain_params("bitcoin/testnet") | |
from bitcointx.wallet import CCoinKey | |
from bitcointx.core import COutPoint, CTxIn, CTxOut, CMutableTransaction, CTxInWitness | |
from bitcointx.core.script import (CScript, OP_CHECKSIGADD, OP_CHECKSIG, OP_NUMEQUAL, | |
TaprootScriptTree, CScriptWitness) | |
from bitcointx.wallet import P2TRCoinAddress | |
from binascii import hexlify, unhexlify |