sBTC Research & Design - Revealer API #345
Replies: 5 comments
-
Under investigation by @radicleart. |
Beta Was this translation helpful? Give feedback.
-
In the call earlier today, I proposed that the revealer service be responsible for serving tapscript data for pending deposits to Stackers, instead of copying it into the The flow would work as follows (note that you will need to scroll to the right to see the full diagram)
When the user requests an address from the revealer, the revealer stores the address' tapscript data locally, and pledges to watch for the arrival of a new UTXO in the Bitcoin mempool for that address for a specified amount of time. In a pinch, you can do this with a 3rd party service like mempool.space [1]. Once the revealer sees that there's a new UTXO for this address (i.e. the user funded the address from their wallet and sent a transaction), then the revealer marks the address as "pending" and pledges to expose it and its tapscripts via a public API endpoint. Meanwhile, at least one signer periodically polls the revealer's API endpoint for new pending transactions. For each new pending transaction, the signer instigates a WSTS (FIRE) signing round to consolidate the user's UTXO with the wallet UTXO. This creates a "consolidation transaction", whose transaction fee is funded by part of the user's UTXO. This consolidation transaction exposes the The Nakamoto group had an interesting idea regarding the consolidation transaction that I'll share here. The consolidation transaction itself can also have an Once the Stacks node successfully processes the consolidation transaction, then the user sees their sBTC balance materialize. [1] https://mempool.space/docs/api/rest#get-address-transactions-mempool |
Beta Was this translation helpful? Give feedback.
-
This is great news for the sbtc contract! Implementation detail - there could be many 'revealer' services. If feasible a web hook style implementation that allows revealers to push to signers might help - or if signers aren't available in this way a smart contract registry where signers can discover revealers. |
Beta Was this translation helpful? Give feedback.
-
Design completed by @radicleart. Note, we'll need to put this into some centralized design location at some point. |
Beta Was this translation helpful? Give feedback.
-
See google design doc. Construction of BTC Transactions for Hand-off & Withdrawal in sBTC |
Beta Was this translation helpful? Give feedback.
-
This discussion is part of a research task to determine the API needed for a revealer service that can reduce the amount of work that the sbtc contract is responsible for.
Beta Was this translation helpful? Give feedback.
All reactions