Skip to content

ARC-84: ASA-Compatible Smart Contract Tokens #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add motivation and some headers
  • Loading branch information
joe-p committed May 28, 2025
commit 4c5ab6bcc3bc211ab3aaf90c3c8b1a9fdc7c2017
67 changes: 66 additions & 1 deletion ARCs/arc-0084.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,80 @@
---
arc: 84
title: ASA-Compatible Smart Contract Tokens
description: A standard for smart contract tokens that are programable but also ASA-compatible

Check failure on line 4 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

preamble header `description` should not contain `standard` (or similar words.)

error[preamble-re-description]: preamble header `description` should not contain `standard` (or similar words.) --> ARCs/arc-0084.md:4:13 | 4 | description: A standard for smart contract tokens that are programable but also ASA-compatible | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ prohibited pattern was matched | = info: the pattern in question: `standar\w*\b`
author: Joe Polny (@joe-p)

Check failure on line 5 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

preamble header `author` has extra whitespace

error[preamble-trim]: preamble header `author` has extra whitespace --> ARCs/arc-0084.md:5:8 | 5 | author: Joe Polny (@joe-p) | ^^^^^^^^^^^^^^^^^^^^ value has extra whitespace |
discussions-to: <URL>

Check failure on line 6 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

preamble header `discussions-to` is not a valid URL

error[preamble-discussions-to]: preamble header `discussions-to` is not a valid URL --> ARCs/arc-0084.md:6:16 | 6 | discussions-to: <URL> | ^^^^^^ relative URL without a base |

Check failure on line 6 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

preamble header `discussions-to` should point to a thread on algorandfoundation/ARCs/issues

error[preamble-re-discussions-to]: preamble header `discussions-to` should point to a thread on algorandfoundation/ARCs/issues --> ARCs/arc-0084.md:6:16 | 6 | discussions-to: <URL> | ^^^^^^ required pattern was not matched | = info: the pattern in question: `^https://github.com/algorandfoundation/ARCs/issues/`
status: Draft
type: Standards Track
category: ARC
subcategory: Application

Check failure on line 10 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

preamble has extra header(s)

error[preamble-order]: preamble has extra header(s) --> ARCs/arc-0084.md:10:1 | 10 | subcategory: Application | ^^^^^^^^^^^ unrecognized header |
created: 2025=05-27

Check failure on line 11 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

preamble header `created` is not a date in the `YYYY-MM-DD` format

error[preamble-date-created]: preamble header `created` is not a date in the `YYYY-MM-DD` format --> ARCs/arc-0084.md:11:9 | 11 | created: 2025=05-27 | ^^^^^^^^^^^ input contains invalid characters |
requires: 4, 22
---

**TODO:** This is currently a placeholder to reserve the ARC number
## Abstract
Abstract is a multi-sentence (short paragraph) technical summary. This should be a very terse and human-readable version of the specification section. Someone should be able to read only the abstract to get the gist of what this specification does.

## Motivation

Algorand Standard Assets (ASAs) offer trusted accounting enforced by the protocol and stable endpoints for transferring assets and reading data via APIs. ASAs, however, do not offer flexibility. Programmability is desirable for various asset-related functionalities such as enforced fees, automatic royalties, balance snapshots, and conditional transfers. There are also some additional challenges and limitations with ASAs, including:

* Developer and user friction with ASA opt-ins
* Immutable metadata fields (and hacky workarounds like ARC19)

Check failure on line 23 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

proposals must be referenced with the form `ARC-N` (not `ARCN` or `ARC N`)

error[markdown-re-arc-dash]: proposals must be referenced with the form `ARC-N` (not `ARCN` or `ARC N`) --> ARCs/arc-0084.md | 23 | * Immutable metadata fields (and hacky workarounds like ARC19) | = info: the pattern in question: `(?i)ARC[\s]*[0-9]+`
* Metadata standards (i.e. ARC3) use off-chain mechanisms, which make metadata inaccessible in smart contracts

Check failure on line 24 in ARCs/arc-0084.md

View workflow job for this annotation

GitHub Actions / ARC Walidator

proposals must be referenced with the form `ARC-N` (not `ARCN` or `ARC N`)

error[markdown-re-arc-dash]: proposals must be referenced with the form `ARC-N` (not `ARCN` or `ARC N`) --> ARCs/arc-0084.md | 24 | * Metadata standards (i.e. ARC3) use off-chain mechanisms, which make metadata inaccessible in smart contracts | = info: the pattern in question: `(?i)ARC[\s]*[0-9]+`

As such, there have been various smart-contract-based token standards but they typically have one or more of the following shortcomings:

* Incompatibility with ASAs (i.e using `uint256` instead of `uint64`)
* Inability to trust accounting logic (without pre-approved programs, which then limit programmability)
* Lack of existing API compatibility
* Difficulty with indexing token balances and transactions

## Specification
The key words "**MUST**", "**MUST NOT**", "**REQUIRED**", "**SHALL**", "**SHALL NOT**", "**SHOULD**", "**SHOULD NOT**", "**RECOMMENDED**", "**MAY**", and "**OPTIONAL**" in this document are to be interpreted as described in <a href="https://www.ietf.org/rfc/rfc2119.txt">RFC-2119</a>.

The technical specification should describe the syntax and semantics of any new feature. The specification should be detailed enough to allow competing, interoperable implementations for any of the current Algorand platforms (go-algorand, ...).

## Rationale

### Core Philosophy: Separate Representations of Same Asset

### Singleton Data Contract With Transfer Hook: Trusted Accounting Logic

### Separation of Transfer and Data Apps: Data Access In Transfer Hooks

### Multiple Transfers Per Call: Atomicity & Verifiability

### Allowances With Cooldown: Safely Enable Delegation Features

### Collections: On-Chain Guarantees for Valuable Collection Data

### App IDs to Identify Tokens: Ensures no ASA ID collision

### uint64 Accounting: Ensure Compatibility with ASAs

## Backwards Compatibility

### Bridging ASAs

#### Auto Bridging

### ASA API Compatibility

#### Params & Metadata

#### Opt-In & Holding Discoverability

### ASA Transfer Compatibility

## Test Cases
Test cases for an implementation are mandatory for ARCs that are affecting consensus changes. If the test suite is too large to reasonably be included inline, then consider adding it as one or more files in `../assets/arc-####/`.

## Reference Implementation
An optional section that contains a reference/example implementation that people can use to assist in understanding or implementing this specification. If the implementation is too large to reasonably be included inline, then consider adding it as one or more files in `../assets/arc-####/`.

## Security Considerations
All ARCs must contain a section that discusses the security implications/considerations relevant to the proposed change. Include information that might be important for security discussions, surfaces risks and can be used throughout the life cycle of the proposal. E.g. include security-relevant design decisions, concerns, important discussions, implementation-specific guidance and pitfalls, an outline of threats and risks and how they are being addressed. ARC submissions missing the "Security Considerations" section will be rejected. An ARC cannot proceed to status "Final" without a Security Considerations discussion deemed sufficient by the reviewers.

## Copyright
Copyright and related rights waived via <a href="https://creativecommons.org/publicdomain/zero/1.0/">CCO</a>.
Loading