Skip to content

ICRC-22: Payment request formats #22

@peterpeterparker

Description

@peterpeterparker

ICRC-22 - Payment request formats

Data Details

  • icrc: 22
  • title: ICRC-22 - Payment request formats
  • author: David Dal Busco - david dot dalbusco at gmail dot com - @daviddalbusco on twitter
  • status: Draft
  • category: ICRC
  • requires: Textual encoding of ICRC-1 accounts
  • created: 2023-06-23
  • updated: 2023-06-23

Context

A standard way of representing payment requests as URLs, which is particularly useful for generating QR codes.

Abstract

"URLs embedded in QR-codes, hyperlinks in web-pages, emails or chat messages provide for robust cross-application signaling between very loosely coupled applications. A standardized URL format for payment requests allows for instant invocation of the user's preferred wallet application (even if it is a webapp or a swarm đapp), with the correct parameterization of the payment transaction only to be confirmed by the (authenticated) user." - source EIP-681.

References

Introduction

The following is a simple adaptation of above listed references to establish a standard way of sharing URLs that represent payment requests on the Internet Computer.

Specification

Payment request URLs are constructed by incorporating the ICRC "token" in the schema (protocol) part of the URL. The format for creating such URLs is as follows:

urn           = token ":" address [ "?" params]
token         = string
address       = <principal>-<checksum>.<compressed-subaccount>
params        = param [ "&" params ]
param         = [ amountparam ]
amountparam   = "amount=" *digit [ "." *digit ]

Where token epresents the symbol of an ICRC token in lowercase, such as "icp" for the Internet Computer.

The address refers to a textual encoding representation of ICRC-1 accounts, as defined in the related standard.

The amount should be provided as a number. The amount represents the amount of tokens in the base unit used by the ledger. It is strongly recommended to use scientific notation for the amount. Decimal representation can be combined with scientific representation, e.g., 4.042E8 ICP means a count of 404200000 base units as managed by the ICP ledger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions