python – How can I tweak a personal key in bitcoin core

0
72


I’ve accomplished the bitcoin taproot workshop a pair instances now and beginning to get a grip of what’s going on, however I can not discover the place I can do the identical issues within the workshop’s offered python libraries with bitcoin core

I feel you should be clearer on precisely what you need to obtain. There may be Taproot code in Python within the Bitcoin Core practical assessments if you wish to dig a bit deeper for instructional functions in Python. However that is not set as much as be a standalone library to work together with. A Python library that does have Taproot assist (and MuSig2 assist) is buidl-python. Different Python libraries like python-bitcoinlib, ofek’s bit and darosior’s python-bip380 do not assist Taproot on the time of writing (Could 2023) sadly.

May bitcoin core profit from this added performance? Command’s like tweak add, Tapleaf development of csa, hashlock, csa hashlock delay and correct Tapscript development?

Bitcoin Core as a full node implementation already helps verifying any Taproot spend in C++. The Bitcoin Core pockets helps Taproot by way of the tr() descriptor once more written in C++. OP_CHECKSIGADD (CSA) is supported by way of the multi_a and sortedmulti_a descriptors inside the tr() descriptor. Hashlocks is not on the time of writing (Could 2023) supported inside the tr() descriptor however there’s a PR open (PR 27255) so as to add Taproot’d Miniscript to the Bitcoin Core pockets which might allow it.

I can generate a brand new deal with, however how do I tweak it with the faucet script?

A notice on the terminology. You tweak the interior public key, you do not tweak the deal with. The way you tweak the interior public secret is defined within the Bitcoin Optech Taproot workshop right here.

I am additionally cautious of producing my very own keys, because the workshop says particularly not to do this. “Unhealthy randomness and no facet channel safety.” to loosely quote.

Proper now it looks like I must implement these options in a separate python library, perhaps by calling bindings to secp256k1 lib for secure randomness?

In case you are utilizing signet or testnet cash you needn’t fear about unhealthy randomness and doubtlessly shedding your cash. However notice the randomness for seeds, non-public keys is not generated in secp256k1, it’s generated in the principle Core repo (random.cpp).

LEAVE A REPLY

Please enter your comment!
Please enter your name here