-
Notifications
You must be signed in to change notification settings - Fork 237
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
Failed to load UTXOs with Taproot wallet #2078
Comments
For a strange reason, this is only a problem until specter is rebooted. Then it disappears. At least i know roughly what's the case here: the taproot transaction is not be considered as
The psbt is created like this:
As this needs to be an issue for the output as the output needs to be
@stepansnigirev can you see any reason why taproot transactions have trouble here? |
If Bitcoin Core does not add taproot fields into PSBT, the descriptor can't verify that the output belongs to the descriptor. What version of Core do you use? |
Oh wait... Specter is creating psbt from transaction itself, then probably the problem is with taproot fields that we don't add in the code. |
I'm using:
Here is the psbt from that tx. Click to expand``` cHNidP8BAH0CAAAAAeU5AjQ3OkQNmC7Act0zvmrRa98XZaH73MV3QWzFbWc0AAAAAAD+////AgQlEwAAAAAAFgAUDshyhY0ZMuW1aDjZW01Pc7Mz63qAlpgAAAAAACJRIGhPDG28WaL+B0Dxql0du4vf2RfEixwwM+Vi4T+8ecKQZQoAAAABAH0CAAAAAcMXj0XQ/cNHEUxb0dd9aKRoovQHvFHEj2gwXLhxvLlAAAAAAAD+////AnjHqwAAAAAAFgAUFuYflFUX6IXeEKF/lNf1GqZx9J6AlpgAAAAAACJRIMKyPPj50EhToC/taMfusSreBpZE8XwrVbMk2Zibm82IMwoAAAEBH3jHqwAAAAAAFgAUFuYflFUX6IXeEKF/lNf1GqZx9J4AAAA= ```
|
Yes, as you see, inputs and outputs don't contain derivation information, so
It could be that Bitcoin Core 23 does it, but I didn't check |
But then, how does the right information gets into the cache? My gues is that the super-confusing fetch_transaction-method does that in this section: Click to expand if self.use_descriptors:
# Get all used addresses that belong to the wallet
addresses_info_multi = self.rpc.multi(
[
("getaddressinfo", address)
for address in [
tx["details"][0].get("address")
for tx in txs.values()
if tx
and tx.get("details")
and (
tx.get("details")[0].get("category") != "send"
and tx["details"][0].get("address") not in self._addresses
)
]
if address
]
)
addresses_info = [
r["result"]
for r in addresses_info_multi
if r["result"].get("ismine", False)
] |
Maybe
|
Yes, another way is to check if addresses used in inputs and outputs belong to the wallet. |
It's an amazing feature. I'll call that from now on an Heisenberg Feature. Update:Ok, i have the "feature". The value in the csv was "false". And we have a
|
The result of Click to expand``` bitcoin-cli -regtest -rpcport=18443 -rpcuser=bitcoin -rpcpassword=secret -rpcwallet="spectera8d0c3bcfa1dd45c/mytaproot" decodepsbt cHNidP8BAH0CAAAAAeU5AjQ3OkQNmC7Act0zvmrRa98XZaH73MV3QWzFbWc0AAAAAAD+////AgQlEwAAAAAAFgAUDshyhY0ZMuW1aDjZW01Pc7Mz63qAlpgAAAAAACJRIGhPDG28WaL+B0Dxql0du4vf2RfEixwwM+Vi4T+8ecKQZQoAAAABAH0CAAAAAcMXj0XQ/cNHEUxb0dd9aKRoovQHvFHEj2gwXLhxvLlAAAAAAAD+////AnjHqwAAAAAAFgAUFuYflFUX6IXeEKF/lNf1GqZx9J6AlpgAAAAAACJRIMKyPPj50EhToC/taMfusSreBpZE8XwrVbMk2Zibm82IMwoAAAEBH3jHqwAAAAAAFgAUFuYflFUX6IXeEKF/lNf1GqZx9J4AAAEFIKecIuQuHcy/Qk9WCw7fpl65aZtsV4cbIyCEhncl+5XXIQennCLkLh3Mv0JPVgsO36ZeuWmbbFeHGyMghIZ3JfuV1xkAxu/5fVYAAIABAACAAAAAgAAAAAACAAAAAA== { "tx": { "txid": "fdd7f2fee8a9e7a1c641898b07cab90df7adad6d698947d19e165f2ad4f22805", "hash": "fdd7f2fee8a9e7a1c641898b07cab90df7adad6d698947d19e165f2ad4f22805", "version": 2, "size": 125, "vsize": 125, "weight": 500, "locktime": 2661, "vin": [ { "txid": "34676dc56c4177c5dcfba16517df6bd16abe33dd72c02e980d443a37340239e5", "vout": 0, "scriptSig": { "asm": "", "hex": "" }, "sequence": 4294967294 } ], "vout": [ { "value": 0.01254660, "n": 0, "scriptPubKey": { "asm": "0 0ec872858d1932e5b56838d95b4d4f73b333eb7a", "hex": "00140ec872858d1932e5b56838d95b4d4f73b333eb7a", "address": "bcrt1qpmy89pvdryewtdtg8rv4kn20wwen86m6jpflrx", "type": "witness_v0_keyhash" } }, { "value": 0.10000000, "n": 1, "scriptPubKey": { "asm": "1 684f0c6dbc59a2fe0740f1aa5d1dbb8bdfd917c48b1c3033e562e13fbc79c290", "hex": "5120684f0c6dbc59a2fe0740f1aa5d1dbb8bdfd917c48b1c3033e562e13fbc79c290", "address": "bcrt1pdp8scmdutx30up6q7x4968dm300aj97y3vwrqvl9vtsnl0rec2gq0kytph", "type": "witness_v1_taproot" } } ] }, "unknown": { }, "inputs": [ { "witness_utxo": { "amount": 0.11257720, "scriptPubKey": { "asm": "0 16e61f945517e885de10a17f94d7f51aa671f49e", "hex": "001416e61f945517e885de10a17f94d7f51aa671f49e", "type": "witness_v0_keyhash", "address": "bcrt1qzmnpl9z4zl5gthss59lef4l4r2n8ray7m8ln0a" } }, "non_witness_utxo": { "txid": "34676dc56c4177c5dcfba16517df6bd16abe33dd72c02e980d443a37340239e5", "hash": "34676dc56c4177c5dcfba16517df6bd16abe33dd72c02e980d443a37340239e5", "version": 2, "size": 125, "vsize": 125, "weight": 500, "locktime": 2611, "vin": [ { "txid": "40b9bc71b85c30688fc451bc07f4a268a4687dd7d15b4c1147c3fdd0458f17c3", "vout": 0, "scriptSig": { "asm": "", "hex": "" }, "sequence": 4294967294 } ], "vout": [ { "value": 0.11257720, "n": 0, "scriptPubKey": { "asm": "0 16e61f945517e885de10a17f94d7f51aa671f49e", "hex": "001416e61f945517e885de10a17f94d7f51aa671f49e", "address": "bcrt1qzmnpl9z4zl5gthss59lef4l4r2n8ray7m8ln0a", "type": "witness_v0_keyhash" } }, { "value": 0.10000000, "n": 1, "scriptPubKey": { "asm": "1 c2b23cf8f9d04853a02fed68c7eeb12ade069644f17c2b55b324d9989b9bcd88", "hex": "5120c2b23cf8f9d04853a02fed68c7eeb12ade069644f17c2b55b324d9989b9bcd88", "address": "bcrt1pc2ere78e6py98gp0a45v0m439t0qd9jy797zk4dnynve3xumekyqc3qsjw", "type": "witness_v1_taproot" } } ] } } ], "outputs": [ { }, { "unknown": { "05": "a79c22e42e1dccbf424f560b0edfa65eb9699b6c57871b232084867725fb95d7", "07a79c22e42e1dccbf424f560b0edfa65eb9699b6c57871b232084867725fb95d7": "00c6eff97d5600008001000080000000800000000002000000" } } ], "fee": 0.00003060 } ```Update: Bitcoin core can't see this fields as that is the point of the fill_psbt method. So decoding it with the help of Core is useless. |
Output contains "unknown" fields that are actually taproot derivations. Bitcoin Core doesn't know what they mean but embit descriptor should be able to detect owned outputs |
A sideeffect of the mitigation of this issue is that the amounts are broken on taproot because |
(Screenshot from revamp branch but same on master)
Steps to reproduce
Create a Taproot wallet, send regtest funds to it from a Segwit wallet to produce an UTXO for the Taproot wallet.
Stacktrace
The text was updated successfully, but these errors were encountered: