Supporting Contract Accounts in Funding New G-Accounts #1668
Replies: 2 comments 18 replies
-
Thanks for opening this discussion. One high level consideration regarding feasibility of this feature is whether a classic account is involved in the flow at any point. Since currently it's not possible to submit a transaction without a classic account paying the fees, the flow could be implemented without any protocol changes in almost the same fashion as it would be implemented for classic payments (via an additional transaction that creates the destination account). The main downside compared to classic is that this would require 2 sequential transactions, which increases the latency. Still, I wouldn't discard this option given its immediacy. If we were to go with a protocol change for this, after thinking about this for a bit I think the following seems to be the best option: modify SAC to create a new G-account in case if it performs a transfer of 1+ XLM to a non-existing G-address. This way the transaction source pays as much fee as it would in case if no new account was created, and the transfer source funds the new account as intended. The only caveat is that transfers of <1 XLM to non-existent addresses will fail, which doesn't seem like a big issue to me (a new account has to take 1 XLM from somewhere). Also, this doesn't provide an explicit 'create account' interface to Soroban, but it doesn't seem to me like that has to be a requirement (please let me know if you think otherwise). |
Beta Was this translation helpful? Give feedback.
-
@marcelosalloum @tomerweller Is the scenario being described here for the native asset only, or for issued assets as well? How does the use case handle issued assets with trust lines? Do existing integrators use claimable balances at all for this? The main benefit to supporting contracts creating accounts is so that account creation could occur at the same time as a payment. But account creation on its own isn't enough for setting up an account for the delivery of a non-native asset. The account will also need to create their trust line. So I think if we hope to solve the problem of create account and pay in a single transaction, we need more than just create account added to Soroban, we also need functions for adding trust lines, where both the sender and the receiver can sign soroban auths to be included in the transaction. The network has another solution for sending to accounts that don't exist: claimable balances. Would that be appropriate to consider instead? But, back to the question at the beginning of my comment, we need to go into more detail on this scenario to better understand the use case. |
Beta Was this translation helpful? Give feedback.
-
Challenge
Currently, Contract Accounts cannot fund the creation of G-accounts, unlike Classic G-accounts, which can create and fund other G-accounts using the
create_account
operation.Account creation requires a triggering actor to cover the base reserve (currently 1 XLM) needed to create and maintain a G-account. Since Contract Accounts cannot pay fees or reserves directly, they are unable to initiate this process.
Why This Matters
For Classic G-accounts, it’s common practice to check if a recipient already exists in the ledger before sending a payment. If not, the sender automatically creates and funds the account. Multiple SDF members have confirmed that this is a fundamental behavior across most Classic wallets.
To maintain feature parity and improve usability, Contract Accounts should support a similar flow.
Next Steps
Since this requires a protocol change, we need to explore potential approaches. Looking forward to feedback and ideas on possible solutions! 🚀
Beta Was this translation helpful? Give feedback.
All reactions