Detailed Flow
A wallet group is formed by randomly selecting 100 members from a pool of nodes, the selection process and the randomness are guaranteed by a mechanism called random beacon. The nodes then perform a DKG to create a wallet, which will receive the BTC from users.
The user provides their ETH address and a BTC recovery address to the dashboard, the dashboard makes a call to the Insaanity contracts and fetches the Deposit address that is unique to that user. The user then makes a deposit to the Deposit address and then confirms their deposit to the Insaanity contracts. The confirmation emits an event that is visible to everyone on the chain. The BTC recovery address comes in handy if the user wants to not go through with confirming the deposit, if the deposit is not confirmed within a certain amount of time, the BTC will be refunded to the BTC recovery address. The Insaanity nodes listen to the events emitted by the Insaanity contracts.
When enough deposit confirmation events are received by the nodes, they put these deposits in a batch and perform a deposit sweep. The nodes submit the proof of the deposit sweep to the Insaanity contracts, on successful verification the amount of BTC deposited gets stored in the Insaanity contracts on ETH. The deposit sweep verifies the BTC deposits, this is the step responsible to bring BTC to ETH. Then the corresponding amount of BTC.i is minted to the ETH address provided by the user.
Last updated