RFC 7: Sweeping coordination
Before generating tECDSA signature, the off-chain client software needs to agree in the signing group on the message being signed. In tBTC v2, the information needed to evaluate the signed message comes from multiple sources that might not be ideally synced with each other. Moreover, it is not possible to establish a precise point in time based on which the information should be retrieved.
This document aims at describing a protocol for reaching an agreement about the Bitcoin sweep transaction between the signing group members.
The protocol should tolerate small differences in the state of the world, as seen by individual signing group members. It should be compatible with a light relay, and support signing retries. All transactions must be sufficiently confirmed and the transaction being signed must adhere to the recent Bitcoin network fees.
During the work on this RFC, I had to adjust some parts of RFC 1. Specifically, I removed the "early sweeping" section that we are going to replace with a market-based solution in the future, and I replaced sweep_max_btc with sweep_max_deposits. The time it takes to sign a sweep transaction input and Ethereum block gas limits put a cap on how many deposits can be swept at once. It makes more sense to trigger sweep early, given the number of deposits rather than look at the amount of BTC deposited because it does not affect the submit SPV proof transaction that much.
Please hold on with reviewing this RFC. There are some performance problems with simultaneous signing of inputs and I need to rethink the approach.
Reworked the RFC after incorporating the changes described in https://github.com/keep-network/keep-core/issues/3366 to the client. This is now ready for review!
Left a non-blocking suggestion for a footnote: I'm good after @michalinacienciala / @lukasz-zimnoch is good!
Is this good to merge?
Ha I almost asked the same last night 😅
I'm going to merge it! If we want to go back and touch it up, I think that can be a separate PR, and I think having rfc-7 in main is more valuable than having this as a PR