Smart Contract Standardized Asset (Stellar Asset Contract) Extension: Memo
Specification
CAP: 0061
Title: Smart Contract Standardized Asset (Stellar Asset Contract) Extension: Memo
Working Group:
Owner: Tomer Weller <@tomerweller>
Authors: Leigh McCulloch <@leighmcculloch>, Tomer Weller <@tomerweller>
Consulted: Nicolas Barry <@monsieurnicolas>, Alex Cordeiro <@accordeiro>, Dmytro Kozhevin <@dmkozh>
Status: Rejected
Created: 2024-08-26
Discussion: TBA
Simple Summary
Implement the SEP-44 for the Stellar Asset Contract.
Motivation
To support an unambiguous method by which contract wallets can transfer Stellar Assets to custodial wallets that require a memo to be associated with the transfer that is populated through to events used to track transfers.
Goals Alignment
This CAP is aligned with the following Stellar Network Goals:
- The Stellar Network should make it easy for developers of Stellar projects to create highly usable products
- The Stellar Network should enable cross-border payments, i.e. payments via exchange of assets, throughout the globe, enabling users to make payments between assets in a manner that is fast, cheap, and highly usable.
Abstract
This proposal introduces a built-in implementation for Stellar Assets of the SEP-44 standard for transferring with an associated memo.
This proposal disallows the subsequent use of the transaction memo field on smart contract transactions.
Specification
XDR Changes
None.
Transactions Changes
The memo field of Transaction must have value MEMO_NONE when SorobanTransactionData is present.
Extended Token Interface
The Stellar Asset Contract interface is extended with one function:
/// Transfer `amount` from `from` to `to`.
///
/// The memo annotates the transfer event.
///
/// # Arguments
///
/// - `from` - The address holding the balance of tokens which will be
/// withdrawn from.
/// - `to` - The address which will receive the transferred tokens.
/// - `amount` - The amount of tokens to be transferred.
/// - `memo` - The memo associated with the transfer.
///
/// # Events
///
/// Emits an event with topics `["transfer", from: Address, to: Address, sep0011_asset: String, memo: u64],
/// data = amount: i128`
fn transfer_memo(env: Env, from: Address, to: Address, amount: i128, memo: u64);
Design Rationale
See SEP-44 for the design rationale of the transfer_memo interface.
The memo field of transactions is disallowed on smart contract transactions to remove any ambiguity that arises by
specifying different memos on the transaction vs within the smart contract invocation. An assessment of transaction memo
usage today with smart contract transactions shows that their use are rare.
Protocol Upgrade Transition
Backwards Incompatibilities
This proposal introduces a breaking change into the Transaction structure where the memo cannot be set for transactions involving smart contracts.
This proposal is otherwise backwards compatible in regards to all existing functionality, however the introduction of
the transfer event with the additional memo topic requires that existing applications be updated to handle the memo
topic being present.
Resource Utilization
This proposal will lead to approximately the same resource usage as exists today.
Security Concerns
This proposal does not introduce any security concerns.
Test Cases
None yet.
Implementation
None yet.
Preamble
Discussion
0 linked threads
- No linked pull requests or issues found.