Context
Our EVM RPC facade (pkg/ethrpc/eth_api.go) currently only supports transfer -- there is no allowance/delegation mechanism. The ERC-20 standard defines approve(spender, amount) and transferFrom(owner, spender, amount), which is the foundation for DApp composability (DEX approvals, token spending caps, third-party payments).
With the CIP-56 contract rewrite to natively implement the Splice Token Standard (canton-erc20#27), we should design the approve/transferFrom pattern properly against the Splice interfaces rather than bolting it onto the old custom model.
Goal
Design and implement approve/transferFrom using the Splice Token Standard primitives, ensuring compatibility with Canton ecosystem wallets and the broader Canton Coin Standard.
Design Exploration
Splice Standard Primitives Available
TransferPreApproval -- pre-authorizes a transfer that a third party can execute. Conceptually similar to ERC-20 approve. The owner creates a pre-approval, and the approved party can later trigger the transfer without further owner interaction.
TransferFactory -- the standard transfer entry point. approve/transferFrom would need to integrate with this flow.
AllocationV1 interfaces -- for atomic settlement / DvP workflows. Could be relevant for more complex approval patterns.
Key Design Questions
Implementation Scope
DAML (canton-erc20):
Middleware (canton-middleware):
Timeline Decision Needed
This needs to be scoped to either CIP-0086 Phase 1 (before April 18) or Phase 2:
Decision: TBD -- needs team discussion on Phase 1 deliverable scope.
Related Issues
Context
Our EVM RPC facade (
pkg/ethrpc/eth_api.go) currently only supportstransfer-- there is no allowance/delegation mechanism. The ERC-20 standard definesapprove(spender, amount)andtransferFrom(owner, spender, amount), which is the foundation for DApp composability (DEX approvals, token spending caps, third-party payments).With the CIP-56 contract rewrite to natively implement the Splice Token Standard (canton-erc20#27), we should design the
approve/transferFrompattern properly against the Splice interfaces rather than bolting it onto the old custom model.Goal
Design and implement
approve/transferFromusing the Splice Token Standard primitives, ensuring compatibility with Canton ecosystem wallets and the broader Canton Coin Standard.Design Exploration
Splice Standard Primitives Available
TransferPreApproval-- pre-authorizes a transfer that a third party can execute. Conceptually similar to ERC-20approve. The owner creates a pre-approval, and the approved party can later trigger the transfer without further owner interaction.TransferFactory-- the standard transfer entry point.approve/transferFromwould need to integrate with this flow.AllocationV1interfaces -- for atomic settlement / DvP workflows. Could be relevant for more complex approval patterns.Key Design Questions
TransferPreApprovalmap toapprove(spender, amount)? Is it 1:1 or are there structural differences (e.g., per-transfer vs cumulative allowance)?transferFromgo through theTransferFactoryor exercise a choice directly on theTransferPreApproval?eth_callforallowance(),eth_sendTransactionforapprove()/transferFrom())Implementation Scope
DAML (canton-erc20):
TransferPreApprovalfrom Splice standardCIP56TransferFactorytransferFrom(which holdings to spend)Middleware (canton-middleware):
approvesupport to EVM RPC facade (eth_sendTransactionwith approve ABI)transferFromsupport to EVM RPC facadeallowancequery to EVM RPC facade (eth_call)TransferPreApprovalcontracts with DB stateTimeline Decision Needed
This needs to be scoped to either CIP-0086 Phase 1 (before April 18) or Phase 2:
TransferPreApprovalmaps cleanly to our needs.approve/transferFromon top of the stable Splice-native foundation.Decision: TBD -- needs team discussion on Phase 1 deliverable scope.
Related Issues