Skip to content
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

CIP-0030 getCollateral could be made more specific #386

Open
klntsky opened this issue Nov 30, 2022 · 1 comment
Open

CIP-0030 getCollateral could be made more specific #386

klntsky opened this issue Nov 30, 2022 · 1 comment

Comments

@klntsky
Copy link
Contributor

klntsky commented Nov 30, 2022

This shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach **AT LEAST** the combined ADA value target specified in `amount` **AND** the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only utxos). If this cannot be attained, an error message with an explanation of the blocking problem shall be returned. **NOTE:** wallets are free to return utxos that add up to a **greater** total ADA value than requested in the `amount` parameter, but wallets must never return any result where utxos would sum up to a smaller total ADA value, instead in a case like that an error message must be returned.

This shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach AT LEAST the combined ADA value target specified in amount AND the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only utxos).

The problem with these requirements is that they are too broad: the implementation that simply returns all UTxOs satisfies them.

I'd suggest enforcing the following property:

  • All strict subsets of the set of returned UTxOs MUST NOT satisfy the minimum ADA collateral requirements (no unnecessary UTxOs must be returned)

Notably, one of the wallets (Eternl) breaks this property, so we cannot simply assume that UTxOs returned as collateral must not be spent, because it's possible that no more (or not enough) UTxOs are left (context)

@rphair rphair changed the title CIP-30 getCollateral could be made more specific CIP-0030 getCollateral could be made more specific Nov 30, 2022
@klntsky
Copy link
Contributor Author

klntsky commented Nov 30, 2022

Another property that can be potentially enforced: the intersection of getUtxos() and getCollateral() sets must be empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant