Bitcoin Stack Trade is a query and reply website for Bitcoin crypto-currency fans. It solely takes a minute to enroll.
Anyone can ask a query
Anyone can reply
The perfect solutions are voted up and rise to the highest
Requested
Seen
42 occasions
I have been operating via the Bitcoin blockchain like this and evaluating the descriptors to https://github.com/bitcoin/bitcoin/blob/grasp/doc/descriptors.md...
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
blockhash = rpc_connection.getblockhash(b)
blockTxDecoded = rpc_connection.getblock(blockhash, 2)
for txid in blockTxDecoded['tx']:
for output in txid['vout']:
# greater than 1 deal with to loop via for descriptors beginning "multi("
for x in rpc_connection.deriveaddresses(output['scriptPubKey']['desc']):
print("deal with: " + str(x) + " with worth: " + str(output['value']))
I discover that…
- within the first 727 blocks, all descriptors are within the format
pk(...
- by block 728 we see our first descriptor beginning
addr(
. - by block 71,036 we see the primary instance of a descriptor beginning
uncooked(
which appears to have been a possible DOS assault per this put up. Then by block 127,630 we get some extra uncooked descriptors that appear ‘legitimate’ (e.g.uncooked(76a91469d28eb9a311256338d281025a7437096149472c88ac61)#22d6jvgp
) - by block 164,467 we get our first descriptor beginning
multi(
- we do not see every other sort of descriptors after this (a minimum of till block 210,000 which is so far as I’ve gone till now). i.e. no descriptors beginning
pkh(
, orwpkh(
orsh(
orcombo(
orwsh(
ortr(
as talked about within the github documentation I linked
Based mostly on this, I’ve some questions I am unable to discover solutions to within the documentation…
- What’s the use case of an
addr
oruncooked
descriptor? Is that this linked to some type of motion that the node who broadcast the transaction made? Or some type of abstraction that bitcoinrpc layers on prime of it? - In case you try to resolve the deal with of a
uncooked
descriptor (e.g.bitcoin-cli deriveaddresses 'uncooked(76a91469d28eb9a311256338d281025a7437096149472c88ac61)#22d6jvgp'
) you get a message sayingDescriptor doesn't have a corresponding deal with
although it’s attainable to interpret the lengthy string inside uncooked(…) as a public key and convert to an deal with. The identical factor is observable withmulti(
descriptors too – addresses can’t be derived with the deriveaddresses perform although you are able to do it your self in python. Presumably each Bitcoin vout at all times sends some quantity of worth to 1-n addresses so the addresses ought to be derivable? Or maybe if my app is attempting to outline UTXO, I can ignore the uncooked descriptors? A few of them I am unable to resolve to an deal with in any respect, e.g.uncooked(736372697074)#pz6xwtp5
. - In keeping with ‘Mastering Bitcoin’, the overwhelming majority of transactions spend outputs locked with a P2PKH script. However I see none within the descriptors (i.e. descriptors beginning with
pkh(
). What I really see is the overwhelming majority are P2PK (i.e. desc beginning withpk(
) - Ought to I anticipate finding the lacking descriptors (
pkh(
, orwpkh(
orsh(
orcombo(
orwsh(
ortr(
) in blocks 210,000 – current? Or are they being aggregated a way into the descriptors I’m seeing thus far:pk(
,addr(
,uncooked(
andmulti(
?
Thanks lots for any assist!