[CAP-72] - Bringing auth customisation to G accounts #1763
Replies: 6 comments 12 replies
-
|
I absolutely love this idea. When chatting with partners, I often heard existing businesses that wanted to support passkeys without having to walk away from G-accounts, which is exactly what you're proposing here |
Beta Was this translation helpful? Give feedback.
-
What is the purpose of this change? Although useful, I don't see it as a requirement for the auth customization. |
Beta Was this translation helpful? Give feedback.
-
|
Can you clarify how the C account would authorize the actions taken for the G account? stellar-core doesn't have awareness of how contracts authorize transactions, so it has to call |
Beta Was this translation helpful? Give feedback.
-
|
I think the proposal makes sense for the most part. The only immediate issue that I see is that I don't think we want to mess with the classic semantics much (i.e. sponsorships, reserves etc.). I think we should be able to add the new signers on the Soroban side via a ContractData entry and not deal with the classic signers at all. There are a few technical nuances that we'll need to figure out, but overall that seems achievable. I think the main downside of that approach is the fact that some account interactions (like merge) won't be possible unless the Soroban signers are restored, but this should be solvable, given that it's not too hard to restore any entry. |
Beta Was this translation helpful? Give feedback.
-
|
I've sketched an initial CAP corresponding to this proposal: CAP-72 (#1786). While working on it, I've realized that this is a good opportunity to cleanup the delegated auth developer experience and came up with a CAP that helps with that: CAP-71 (#1785). I've opened a separate discussion for it as well: https://github.com/orgs/stellar/discussions/1784. I'll update the discussion soon. Note, that both CAPs focus on the account-related functionality, neither one of them is covering the trustline modification, as I'm not sure yet how exactly this should look like. Discussion point: the initial version of CAP-72 that I came up with is using a contract data entry to store the new signers introduced from Soroban. I think that will work fine. But if we'll end up adding trustlines from Soroban as well, then we'll need to figure out the base reserves/sponsorships anyways, so the exact storage approach to take for this CAP is still up to debate. |
Beta Was this translation helpful? Give feedback.
-
Without knowing the details. That would have been very handy though. You could basically manage fully a G address with a smart contract. E.g. make a full custodial solution with set of signers depending on rules like amount, time, recent volume, allow list. Etc. We can argue that at that point we can just use the C addresses, but exchanges, custodial solutions (like Fireblocks), etc. do not really support C addresses and it's going to take a long time until this happens (cf muxed account.) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This proposal is a modification of what I previously posted in #1751, but achieves the same goal.
I propose that the protocol accept changes that bring auth customisation to G accounts:
Context:
Contract accounts on Stellar are fully customisable, but wallets get access to more of the ecosystem today with a G account.
One type of functionality that some wallets want to adopt is passkeys, and specifically, the recovery processes available to pass keys on modern phones where they get backed up to Apple and Google accounts. However, to adopt passkeys is to adopt a contract account and step away from everything the ecosystem has only for G accounts.
In the past we’ve discussed the possibility of a C account being a signer for a G account. The problem with a C account being an account signer of transactions is that the contract runtime would have to execute arbitrary logic during pre-apply checks without a guarantee of being paid for the resource usage.
G accounts can have up to 20 signer sub-entries. The signers can be a variety of types, but the most common are G keys. Each sub-entry must be sponsored with a reserve amount of XLM. Sub-entries can be sponsored by other accounts, but removing a sponsored entry and replacing it requires the sponsor to re-authorise the new sponsorship.
Proposed changes:
1️⃣ Add support for contracts being signers of a G account.
The signer would be able to sign Soroban Auths, but not Transactions. The contract signer would be able to authorize any operation that a G account can perform on Soroban.
2️⃣ G accounts becoming a built-in contract, with functions for changing the state of the account, specifically: adding/removing signers.
3️⃣ Optional: Add a function to the SAC for a G account to trust / distrust the asset (manage their trust line).
4️⃣ Allow the addition of a sub-entry to reuse sponsorship or a matching deletion in the same operation without requiring authorisation from the sponsor.
This would allow a contract invocation replacing a signer to reuse existing sponsorship, without needing to resolve the issue of sponsorship on the soroban side, or finding a way to bring sponsorship operations to Soroban.
Use cases:
Device key wallets with passkey recovery
[Dependent on changes 1️⃣ 2️⃣ 4️⃣]
A wallet where a device key is the regular signer, and a passkey is a backup used for recovery.
This device key model is the same model described and used by SEP-30.
This use case can be added as an add-on to any existing G account wallet, without that wallet adopting Soroban for anything other than for the backup and recovery flow.
Passkey wallets
[Dependent on changes 1️⃣ 2️⃣ 3️⃣ 4️⃣]
A wallet where the only signer is a passkey.
Why:
To enable fully independent G accounts that utilise passkeys for account recovery, and/or passkeys for day-to-day operations.
To enable any other custom auth to be available to G account, either as a way to auth day-to-day operations, or just for account recovery.
The problem of who needs to sponsor the new signer does not need to come into play as long as the rule is that replacement of the signer reuses existing sponsorship. It allows wallets to use sponsorship or not, without sponsorship needing to be a complexity on the contract side and keeps the contract side complexities of implementation to a minimum.
Beta Was this translation helpful? Give feedback.
All reactions