keep-core icon indicating copy to clipboard operation
keep-core copied to clipboard

tECDSA signing: Setup of the test loop and signing executor

Open lukasz-zimnoch opened this issue 3 years ago • 1 comments

Refs: https://github.com/keep-network/keep-core/issues/3042 Depends on: https://github.com/keep-network/keep-core/pull/3209

Here we are setting up the tECDSA signing test loop and the tECDSA signing protocol executor, without executing the actual signing logic yet. Specific changes are summarized below.

Test loop setup

The signing loop was set up using a temporary chain mock that generates a new tbtc.SignatureRequestedEvent periodically targeting the recently created wallet. The signature request is about signing the hash of the block the event was generated at. The tbtc application node listens for the aforementioned events and decides about joining the signing process if the node controls at least one of the requested wallet's signers.

Worth mentioning that this trigger of the signing process is temporary, and ultimately, the signing process will not be initiated explicitly by the chain. Instead of that, the tbtc node will observe domain events emitted by the Bridge contract` and react to them by constructing and signing specific BTC transactions or other data required by the given use case.

Signing protocol executor setup

Once the tbtc node decides to join the given signing execution, it must set up the tECDSA signing protocol executor properly. This includes setting up the right broadcast channel and determining all the input parameters required by the tECDSA signing executor. This PR addresses those requirements within the joinSigningIfEligible function.

Additionally, we are also exposing the executor function itself. The function is called pkg/tecdsa/signing.Execute and this PR focuses on defining its public API. The actual logic is just a stub at the moment and will be addressed in further PRs.

Next steps

This PR is just a part of the entire work regarding the tECDSA signing test loop. Please refer to the description of https://github.com/keep-network/keep-core/issues/3042 for the full roadmap and the current status of the work.

lukasz-zimnoch avatar Aug 30 '22 12:08 lukasz-zimnoch

The code is ready for review. I'll undraft once https://github.com/keep-network/keep-core/pull/3209 and manual testing of this PR is done.

lukasz-zimnoch avatar Aug 30 '22 13:08 lukasz-zimnoch