RPC: correctly display signblock_witness post-dynafed#1108
RPC: correctly display signblock_witness post-dynafed#1108stevenroose merged 2 commits intoElementsProject:masterfrom
Conversation
|
Hmm, a witness isn't a script, it's just a series of pushes. So I don't think it really makes sense to show it as ASM. Even for p2sh where you seem to expect to show a script, it's still just a push of bytes that can be interpreted as a script. I think the general consensus is that witnesses shouldn't be displayed as scripts. That's also why in the rust-bitcoin and rust-elements ecosystem, witnesses are |
|
I see... in that case, do you think that the |
|
Oh I didn't realize it used to be there. I suppose for backwards compatibility, we can leave it as is for pre-dynafed and drop it for dynafed. Ah yeah pre-dynafed the "witness" is actually a "scriptSig" which is a script containig a series of pushes. But afterwards it's "segwit-style" and it's no longer a script, but just a series of pushes. |
…move irrelevant 'signblock_witness_asm' field in post-dynafed RPC response
…rrelevant 'signblock_witness_asm' field in post-dynafed RPC response
8f43e53 to
f79c148
Compare
|
Fixed. The new Now, a user can view the underlying blocksigning script (the one which is being hashed) as follows: |
|
utACK f79c148 |
Fixes #1102.
Note: the following examples were all run on the liquidv1 network.
Before this change, headers for all dynafed blocks were displayed as follows (note the empty
signblock_witness_*fields):With this change, the same RPC call will produce the following response:
This MR also fixes an identical issue with the
getblockRPC.I had to add dedicated logic to parse script witnesses into the human-readable ASM format, since I couldn't find anything in the codebase that would do that already.
It is useful to decode the signblock_witness like this because it allows a user to quickly see the script that the network is currently using for block signing. The actual
signblockscriptfield does not tell a user much on its own, since it is just a P2WSH -- the pertinent script is the final item in the witness.