Replies: 4 comments 10 replies
-
Pinging @hstove @hozzjss @MarvinJanssen @friedger & anyone else familiar with Clarity patterns for feedback here & in the accompanying draft PR. The main question in mind is: does the latest PR satisfy the requirements for making the sBTC protocol modular / upgradeable? If not, what's the best alternative here? As mentioned above I can wrap my head around using traits/proxies but could use some context on pros/cons I'm not seeing. |
Beta Was this translation helpful? Give feedback.
-
You've probably seen it already, but this PR and the discussion therein has tons of pointers: stacksgov/sips#176 |
Beta Was this translation helpful? Give feedback.
-
What is the governance model for sBTC? Maybe it is easy for the entities in power to upgrade. |
Beta Was this translation helpful? Give feedback.
-
In theory it should be possible for the signers to create a valid Stacks multisig address and do a deployment using it. Would it count as governance by virtue of such a transaction being mined successfully? |
Beta Was this translation helpful? Give feedback.
-
Updating The sBTC Protocol (clarity contracts)
Overview
This discussion is meant to lay down the suggested / standard way of decoupling this protocol to make it more modular for future updates. There is an existing way of doing this that'll be mentioned below; this will be the how the contracts are first updated. Afterwards, we'll mention shortcomings with this method & mention alternative updates.
Standard Implementation
Currently, the sBTC protocol is made up of five contracts, each with distinct responsibilities that lay the ground for an upgradeable protocol:
1. sbtc-registry - holds the state of the protocol
2. sbtc-token - SIP10 fungible token contract
3. sbtc-deposit - contract for Emily API to complete deposits
4. sbtc-withdrawal - contract for Stacks principals to initial / complete withdrawals
5. sbtc-bootstrap-signers - pseudo-governance contract for the active signer set
While the protocol is currently not updateable, the responsibilities are structured in a way that makes it relatively easy to update three contracts: sbtc-deposit, sbtc-withdrawal, & sbtc-bootstrap-signers.
Modularization With Existing Setup
With the existing setup, we'll need the following steps:
A draft of this can now be seen here that updates the 'deposit' contract: #1008
Alternate Form Of Updating Protocol
As discussed during our daily standups & now seen in a few upcoming/recent protocols, there's an alternate path here that involves creating traits & proxy contracts for each of the protocol contracts. Another consideration is whether this pattern will allow us to also update the sbtc-registry/state contract(?)
re: using traits & proxy contracts
My understanding is that traits are most effective when dynamically passing-in a contract that must adhered to abc standards. The most clear example of this is a dex/liquidity pool in which the protocol must support passing in infinite types of SIP10 contracts. Since no contracts are passed in dynamically, the benefits of making traits & proxy contracts for the three upgradeable types of contracts (signer/deposit/withdrawal) aren't very clear to me. If anything, defining traits now means we'd have less flexibility on how we update the three contracts.
re: updating state
Currently, the token & state (sbtc-registry) contract are not upgradeable. The token contract has built-in Clarity Values that make it basically impossible to upgrade; the state contract might be upgradeable with a more complicated structure the de-couples the 'state' from the 'active' contracts. But it's still unclear to me whether this behavior (updating state) is desireable.
Beta Was this translation helpful? Give feedback.
All reactions