-
Notifications
You must be signed in to change notification settings - Fork 140
p2tr script path: invalid script (witness stack last element) #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This may be due to btcdeb not being updated to latest core base. I plan to do this but work keeps getting in my way. Plan to get to this ASAP but will take a couple weeks. |
I believe that I'm experiencing a similar issue, however I'm so new to btcdeb that it's likely user error. Im trying to debug a tapscript spend from earlier this morning on signet. It's an attempt at a primary-path-spend of a default Liana ExpandingMultisig taproot output. Running btcdeb in a docker instance: tx=0200000000010119f605e6cd37dd5d780e15c71d57d4e7c23dea56b64b9378b311addc540bc2cf0000000000fdffffff03701101000000000022512045ed102fa4b1057db7c8c7356bf885a567e25d45d3b119d111dc829a3511c2c4f824010000000000160014c675e0b4b427a33c62147702f6f315497b33fd6cc0d0000000000000160014447fde1e37d97255b5821d2dee816e8f18f6bac90440f0eccd95efadd740fbe18f93a4441b72d9100022ec364e17a23a3ee7ff0a3b6f0c9954da42a58d0834802974e291cfafe3182f18ec25cafac307ec813d2e5ed3401e12c03bf63d41f87a2fd792b77faf816b65f720483d227898f8f41efe696f22a38baf9f24e4bcf210dbbdaefd53d8a2a63bda5600388545177380de988b42aa46203c343e06381b7e7926fdbe54c63ab0040c5c2c8491e2d4bd7238cb9066040a1bac2046023b7872e0027577d8a451389bc5a430e729f2d389a23ecca1237dc3b7f7d6ba529c41c0baf872c3fb5bdb356615e7045ed8306d56e0df10c31fd2f0143192d2dd812183d1742e6161782799d44467ab0dc374b1cb88bc2f719e44bc49f9ea545c9ed255e3920300
txin=0200000000010103dc016b3823bb1d01244ffce1a1117704183ced100b51601b70d694213c88c90000000000fdffffff03400d03000000000022512035d2966e0b441e406248f4ed8a69a6283536a85ec03c974687291948265cee37400d03000000000022002078e59302d5539fe4c7191c10ad246f856f75e80f07a30ad419993579c02e44d773424a0000000000160014b7e7f48e5c3bd445be101eb5835021219ced250c0247304402207768183ffd882c935d403f822b88c625d36687005d36707acd9a6e157f5a0b1c022056ab74972e275df0ddcc6c1bec45eda7a3ad8a73db7a92835a5cf493b31e91730121028ef9b939e3eba3b7ae30c01e1e5b3633195448b264510cccac951055d6910ccbe092030
/tmp/btcdeb # btcdeb --tx=$tx --txin=$txin
btcdeb 5.0.24 -- type `btcdeb -h` for start up options
LOG: signing segwit taproot
notice: btcdeb has gotten quieter; use --verbose if necessary (this message is temporary)
input tx index = 0; tx input vout = 0; value = 200000
got witness stack of size 4
34 bytes (v0=P2WSH, v1=taproot/tapscript)
Taproot commitment:
- control = c0baf872c3fb5bdb356615e7045ed8306d56e0df10c31fd2f0143192d2dd812183d1742e6161782799d44467ab0dc374b1cb88bc2f719e44bc49f9ea545c9ed255
- program = 35d2966e0b441e406248f4ed8a69a6283536a85ec03c974687291948265cee37
- script = 203c343e06381b7e7926fdbe54c63ab0040c5c2c8491e2d4bd7238cb9066040a1bac2046023b7872e0027577d8a451389bc5a430e729f2d389a23ecca1237dc3b7f7d6ba529c
- path len = 1
- p = baf872c3fb5bdb356615e7045ed8306d56e0df10c31fd2f0143192d2dd812183
- q = 35d2966e0b441e406248f4ed8a69a6283536a85ec03c974687291948265cee37
- k = f3d10d8d25c08673e65cbba3680bc92a1e66fe15bff701744deeb349361a708a (tap leaf hash)
(TapLeaf(0xc0 || 203c343e06381b7e7926fdbe54c63ab0040c5c2c8491e2d4bd7238cb9066040a1bac2046023b7872e0027577d8a451389bc5a430e729f2d389a23ecca1237dc3b7f7d6ba529c))
invalid script (witness stack last element)
The descriptor does include OP_CHECKSIGADD view on mempool.space so I'll pay attention to pr #151 ADDED: after removing btcdeb docker container, checking out pr151, rebuilding docker and btcdeb: I can now debug the above transaction w/o the above error. |
Thank you for sharing this issue so that I could find this. Wondering what your solution was? If you didn't already have a solution, have you seen pr 151, which addresses OP_CHECKSIGADD. I had a similar error this morning. I tried pr 151 and was able to fully debug my transaction. Using the pr 151 build, I tried yours, and I get past the initial load, can step twice but on third step "Invalid Schnorr signature hash type". |
I created and successfully mined a
regtest
network transaction that spent two p2tr script-path outputs. The scripts where 1 of 2 multisigs:The transaction was accepted by the regtest network bitcoin-core 0.25 and successfully mined. Trying to verify it with btcdeb, I got
invalid script (witness stack last element)
error:I tried to decode the tapscript with bitcoin-cli, and noticed that it was labeled
"nonstandard"
and that the keys that I put in the descriptors lost their parity prefixes and became x-only keys:What is the reason for this
invalid script (witness stack last element)
error, while the transaction was accepted by the core v0.25 and mined successfully?The text was updated successfully, but these errors were encountered: