URI scheme blockchain information | Algorand Developer Portal

URI scheme blockchain information

Abstract

This URI specification defines a standardized method for querying application and asset data on Algorand. It enables applications, websites, and QR code implementations to construct URIs that allow users to retrieve data such as application state and asset metadata in a structured format. This specification is inspired by ARC-26 and follows similar principles, with adjustments specific to read-only queries for applications and assets.

Specification

General Format

Algorand URIs in this standard follow the general format for URIs as defined in RFC 3986. The scheme component specifies whether the URI is querying an application (algorand://app) or an asset (algorand://asset). 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)

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)

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

algorandappurn     = "algorand://app/" appid [ "?" noopparams ]

appid              = *digit

noopparams         = noopparam [ "&" noopparams ]

noopparam          = [ boxparam / globalparam / localparam ]

boxparam           = "box=" *qbase64url

globalparam        = "global=" *qbase64url

localparam         = "local=" *qbase64url "&algorandaddress=" *base32

tealcodeparam      = "tealcode"

algorandasseturn   = "algorand://asset/" assetid [ "?" assetparam ]

assetid            = *digit

assetparam         = [ totalparam / decimalsparam / frozenparam / unitnameparam / assetnameparam / urlparam / hashparam / managerparam / reserveparam / freezeparam / clawbackparam ]

totalparam         = "total"

decimalsparam      = "decimals"

frozenparam        = "frozen"

unitnameparam      = "unitname"

assetnameparam     = "assetname"

urlparam           = "url"

metadatahashparam  = "metadatahash"

managerparam       = "manager"

reserveparam       = "reserve"

freezeparam        = "freeze"

clawbackparam      = "clawback"

Parameter Definitions

Application Parameters

Asset Parameters

Query Key Descriptions

For each parameter, the query key name is listed, followed by its purpose:

Example URIs

  1. Querying an Application’s Box Storage:
algorand://app/2345?box=YWxnb3JvbmQ=

Queries box storage with a base64url-encoded key.

  1. Querying Global Storage:
algorand://app/12345?global=Z2xvYmFsX2tleQ==

Queries global storage with a base64url-encoded key.

  1. Querying Local Storage:
algorand://app/12345?local=bG9jYWxfa2V5&algorandaddress=ABCDEFGHIJKLMNOPQRSTUVWXYZ234567

Queries local storage with a base64url-encoded key and specifies the associated account.

  1. Querying Asset Details:
algorand://asset/67890?total

Queries the total supply of an asset.

Rationale

Previously, the Algorand URI scheme was primarily used to create transactions on the chain. This version allows using a URI scheme to directly retrieve information from the chain, specifically for applications and assets. This URI scheme provides a unified, standardized method for querying Algorand application and asset data, allowing interoperability across applications and services.

Security Considerations

Since these URIs are intended for read-only operations, they do not alter application or asset state, mitigating many security risks. However, data retrieved from these URIs should be validated to ensure it meets user expectations and that any displayed data cannot be tampered with.

Copyright

Copyright and related rights waived via CCO.