Skip to content

Commit

Permalink
Changes based on RFC 3986 + metadatahash
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoWeezy committed Dec 3, 2024
1 parent 431c3d3 commit 73c9f37
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions ARCs/arc-0080.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,29 @@ The scheme component specifies whether the URI is querying an application (`algo
Query parameters define the specific data fields being requested.
Parameters may contain characters outside the valid range. These must first be encoded in UTF-8, then percent-encoded according to RFC 3986.

### Application Query URI (`algorand:app://`)
### Application Query URI (`algorand://app`)

The application URI allows querying the state of an application, including data from the application’s box storage, global storage, and local storage.
And the teal program associated.
Each storage type has specific requirements.

### Asset Query URI (`algorand:asset://`)
### Asset Query URI (`algorand://asset`)

The asset URI enables retrieval of metadata and configuration details for a specific asset, such as its name, total supply, decimal precision, and associated addresses.

### ABNF Grammar

```abnf
algorandappurn = "algorand:app://" appid [ "?" noopparams ]
algorandappurn = "algorand://app/" appid [ "?" noopparams ]
appid = *digit
noopparams = noopparam [ "&" noopparams ]
noopparam = [ boxparam / globalparam / localparam ]
boxparam = "box=" *qbase64url
globalparam = "global=" *qbase64url
localparam = "local=" *qbase64url "&"account=" *base32
localparam = "local=" *qbase64url "&algorandaddress=" *base32
tealcodeparam = "tealcode"
algorandasseturn = "algorand:asset://" assetid [ "?" assetparam ]
algorandasseturn = "algorand://asset/" assetid [ "?" assetparam ]
assetid = *digit
assetparam = [ totalparam / decimalsparam / frozenparam / unitnameparam / assetnameparam / urlparam / hashparam / managerparam / reserveparam / freezeparam / clawbackparam ]
totalparam = "total"
Expand All @@ -57,24 +57,20 @@ frozenparam = "frozen"
unitnameparam = "unitname"
assetnameparam = "assetname"
urlparam = "url"
hashparam = "metadatahash"
metadatahashparam = "metadatahash"
managerparam = "manager"
reserveparam = "reserve"
freezeparam = "freeze"
clawbackparam = "clawback"
```

- "qchar" corresponds to valid characters of an RFC 3986 URI query component, excluding the "=" and "&" characters, which this specification takes as separators.
- "qbase64url" corresponds to valid characters of "base64url" encoding, as defined in <a href="https://www.rfc-editor.org/rfc/rfc4648.html#section-5">RFC 4648 section 5</a>

### Parameter Definitions

#### Application Parameters

- **`boxparam`**: Queries the application’s box storage with a key encoded in `base64url`.
- **`globalparam`**: Queries the global storage of the application using a `base64url`-encoded key.
- **`localparam`**: Queries local storage for a specified account. Requires an additional `algorandaddress` parameter, representing the account whose local storage is queried.
- **`account`**: Account to be used in Application NoOp method call foreign accounts array.

#### Asset Parameters

Expand All @@ -84,7 +80,7 @@ clawbackparam = "clawback"
- **`unitnameparam`** (`unitname`): Queries the short name or unit symbol of the asset (e.g., "USDT").
- **`assetnameparam`** (`assetname`): Queries the full name of the asset (e.g., "Tether").
- **`urlparam`** (`url`): Queries the URL associated with the asset, providing more information.
- **`hashparam`** (`metadatahash`): Queries the metadata hash associated with the asset.
- **`metadatahashparam`** (`metadatahash`): Queries the metadata hash associated with the asset.
- **`managerparam`** (`manager`): Queries the address of the asset manager.
- **`reserveparam`** (`reserve`): Queries the reserve address holding non-minted units of the asset.
- **`freezeparam`** (`freeze`): Queries the freeze address for the asset.
Expand Down Expand Up @@ -113,19 +109,25 @@ For each parameter, the query key name is listed, followed by its purpose:

1. **Querying an Application’s Box Storage**:
```
algorand:app://12345?box=YWxnb3JvbmQ=
algorand://app/2345?box=YWxnb3JvbmQ=
```
Queries box storage with a `base64url`-encoded key.

2. **Querying Global Storage**:
```
algorand:app://12345?global=Z2xvYmFsX2tleQ==
algorand://app/12345?global=Z2xvYmFsX2tleQ==
```
Queries global storage with a `base64url`-encoded key.

3. **Querying Asset Details**:
3. **Querying Local Storage**:
```
algorand://app/12345?local=bG9jYWxfa2V5&algorandaddress=ABCDEFGHIJKLMNOPQRSTUVWXYZ234567
```
Queries local storage with a `base64url`-encoded key and specifies the associated account.

4. **Querying Asset Details**:
```
algorand:asset://67890?total
algorand://asset/67890?total
```
Queries the total supply of an asset.

Expand Down

0 comments on commit 73c9f37

Please sign in to comment.