utxostack / btc-assets-api

Bitcoin/RGB++ Assets API
https://api.rgbpp.io/docs
Apache License 2.0
4 stars 1 forks source link

Is it better to unlock jobs which `after < BTC_JUMP_CONFIRMATION_BLOCKS` #124

Open Flouse opened 7 months ago

Flouse commented 7 months ago

Context

https://github.com/ckb-cell/btc-assets-api/blob/1cf58ea3ac6e381d3f67c3b3be448d8c818a4c74/src/services/unlocker.ts#L76-L85

TL;DR

Q: Is it better to unlock jobs which after < BTC_JUMP_CONFIRMATION_BLOCKS A: Yes.

Reason

In the BTCTimeLock contract, MIN_BTC_TIME_LOCK_AFTER=6. See also:

ahonn commented 6 months ago

We do this now, and what we need to discuss here is whether to delay processing when the after field of the cell is small then BTC_JUMP_CONFIRMATION_BLOCKS

Flouse commented 6 months ago

When the after field of the cell is smaller then BTC_JUMP_CONFIRMATION_BLOCKS and the related btc transaction confirmation is smaller then BTC_JUMP_CONFIRMATION_BLOCKS, the unlocking btc-time-lock transaction will fail.

So, I think it should be delayed.