-
Notifications
You must be signed in to change notification settings - Fork 178
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
make selection of ioauth input more clever #957
Conversation
This point may or may not be obvious but we should discuss it explicitly: An essentially identical problem exists taker side: if they don't have a "native" type utxo, they will crash in trying to generate a PoDLE that uses a non-native key type. So, the current code just tries to select an in-transaction utxo for PoDLE generation, else in-mixdepth, we need to check how to rewrite that code so that it can hopefully use this same logic. Maybe some kind of janky |
Isn't the taker side a lot more complex? The code additionally checks if the utxo is "too_young" (although this is called "too_old" in the code) and "too_small". Besides those criteria, wouldn't randomly adding utxos to a taker cj mess up tumbler schedules? |
Not sure what you mean by that part. I don't think we'd be adding random utxos to any specific joins or schedules? It's just filtering the choice of PoDLE utxo as per for the maker filtering the choice of authorizing utxo. |
ah, yes. The change would end up in the same mixdepth anyway. Had an error in my thinking here. |
Once I actually tried this in a manual test, I immediately realized that there is a big aspect left unconsidered: the maker has to sign for the timelocked input correctly (that part should be fine), but then has to transfer the signature to the taker - this part is non-standard, and I can see that right now it is borked and I'm not sure it can be fixed without upgrading taker code. Apologies, I feel kinda stupid now that I didn't even think about it until I actually manually carried out the transaction (and then it was immediately obvious!). I will keep looking at it today but I strongly doubt, now, that we will be able to implement spending timelock type outputs in coinjoins, at least for the time being. (In case it isn't obvious what I'm talking about, look at how the joinmarket-clientserver/jmclient/jmclient/maker.py Lines 157 to 171 in 7a50c76
If you look at the taker's processing in Edited to add: it may seem weird that the message even gets to the taker at all, but it's just because the witness for this p2wsh case consists of The long and the short is: we just haven't written Joinmarket to support arbitrary scripts, yet, albeit we have the backend that could support it, in future. |
I should qualify the above: none of that prevents a taker from using a custom script, and I think that should work once we address the PoDLE issue. The maker's |
jmclient/jmclient/wallet.py
Outdated
@@ -889,6 +916,16 @@ def yield_imported_paths(self, mixdepth): | |||
""" | |||
return iter([]) | |||
|
|||
def is_standard_wallet_script(self, path): | |||
""" | |||
Check if the priv/pub key pair referenced by path is of the same |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still nit on this comment: the priv/pub keypair itself is not intrinsically anything, only the scriptPubKey constructed from it, is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8c3ae11
jmclient/jmclient/yieldgenerator.py
Outdated
mixdepth, utxos = self._get_order_inputs( | ||
filtered_mix_balance, offer, required_amount) | ||
except NoIoauthInputException: | ||
jlog.error('unable to fill order, no suitable IOAUTH UTXO found. In order to spend coins (UTXOs) from a mixdepth using coinjoin, there needs to be at least one standard wallet UTXO (not fidelity bond or different address type).') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason not to wrap the line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 8c3ae11
2c143d1 test suite and flake passing locally. |
2c143d1
to
804c214
Compare
squashed and rebased |
804c214
to
8c3ae11
Compare
The error in test_payjoin is unrelated (and nondeterministic, I believe). Merging after my previous checks. |
attempts to fix the issue outlined by @AdamISZ in #955 (comment)
Instead of blindly selecting the first selected utxo for ioauth purposes the new code makes sure there actually is a suitable utxo at that position, or aborts the coinjoin if this is not possible.