stacks-network / sbtc-developer-release

sBTC primitives, signer components, helper tools
https://sbtc.tech
MIT License
1.98k stars 23 forks source link

[stacks-signer] Determine if wallet handoff needs to occur #395

Open jferrant opened 11 months ago

jferrant commented 11 months ago

Description

Create a helper function that determines whether wallet handoff needs to happen based on signer state/pox 4 state (DKG wallet for next reward cycle should be set)

Context

Signers need to hand off BTC funds to the next signers. They should thereofre be checking whether handoff needs to occur before doing so (can only happen after the start of the prepare phase of the next reward cycle since signers must be known and they must have already performed their own DKG round/vote)

Expected Approach

Query the pox 4 contract for the DKG address of the next reward cycle. If not set, return false. If set, check if we are not already performing handoff. If not, return true, else false.