-
Notifications
You must be signed in to change notification settings - Fork 372
fix(ckdoge): reject deposits below minimum amount #8428
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| for utxo in processable_utxos { | ||
| if utxo.value <= check_fee { | ||
| let ignored_reason = if utxo.value < deposit_btc_min_amount { |
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.
Nit: One would expect that a deposit of exactly deposit_btc_min_amount is permissible because the name suggests that it is the minimum accepted value.
| ecdsa_key_name : text; | ||
|
|
||
| // The minimal amount of BTC that can be converted to ckBTC. | ||
| deposit_btc_min_amount : opt nat64; |
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.
What is the advantage of having a concrete parameter?
Why not simply have effective_deposit_min_btc_amount return max(MINTER_ADDRESS_P2WPKH_DUST_LIMIT, check_fee+1)?
| ecdsa_key_name : text; | ||
|
|
||
| // The minimal amount of DOGE that can be converted to ckDOGE. | ||
| deposit_doge_min_amount : opt nat64; |
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.
The same question here: Is there a good reason to have this as a parameter?
ninegua
left a comment
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.
Thanks! LGTM
Ensure that DOGE deposits will be ignored when their value is below a configurable minimum amount. This is needed to ensure that the minter does not control UTXOs whose value are below the dust threshold (0.01 DOGE). This was not a problem for ckBTC, which deducts a
check_feeon the deposited UTXO value and whose value is above the Bitcoin dust threshold. In contrast, ckDOGE does not deduct a checker fee (check_feeis0), but still requires deposited UTXOs to have sufficient value.For that reason, the following changes were made to the ckBTC and ckDOGE minter:
deposit_btc_min_amount, which controls the minimum value a deposited UTXO must have to avoid being ignored.check_feeanddeposit_btc_min_amount) is returned as part of theMinterInfoand displayed on the minter dashboard.About
CI_OVERRIDE_DIDC_CHECK: the following non-breaking changes were made to the Candid interface:ckbtc_minter.didInitArgsandUpgradeArgsMinterInfockdoge_minter.did: the ckDOGE minter is not yet live, so that any change here is by definition not breaking.