aboutsummaryrefslogtreecommitdiff
path: root/payto-payment-target-types/eth.txt
blob: 356f17d2fb71a0e87914cbd30d97a4f5bd3fd662 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Payto Payment Target Type for Ethereum-compatible Blockchain Addresses

## Target Type "eth"

Name: eth

Description:  Ethereum-compatible Blockchain Address

  The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
  NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
  "MAY", and "OPTIONAL" in this document are to be interpreted as
  described in RFC 2119 and RFC 8174.

  The path consists of two components: The chain ID and the
  Ethereum-compatible Mixed-case checksum address.

  This is used to uniquely identify both the chain and the account
  on the chain. The chain ID is used to prevent replay attacks
  between different chains. If the checksum is invalid, the address
  and corresponding URI is invalid and the payment should not be sent.
  Connecting to the chain is out of scope for this specification. If
  the chain is not available, the payment should not be sent, but the
  URI is still valid.

  The currency type can be omitted from the amount option, leaving
  a simple decimal number with a maximum of 8 decimal places.
  If the currency type (as part of the amount) is not present,
  the currency is assumed to be the native currency of the chain.
  If the currency is present, it must be a valid ERC-55 address
  pointing to a valid ERC-20 token contract on the chain. If the
  currency is not a valid ERC-20 token, then the URI is invalid.
  This includes three-letter currency codes, which are not valid
  ERC-20 token addresses.


Syntax:
     payto-eth-URI = "payto://eth/" addr [ "@" chain_id ] [ "?" opts ]

  'addr' is an Ethereum-compatible Mixed-case checksum address
  as defined in [ERC-55](https://eips.ethereum.org/EIPS/eip-55).
  It MUST not be the zero address, and the checksum MUST be valid.
  If either of these conditions is not met, the URI is invalid.

  'chain_id' is an Ethereum chain ID as defined in 
  [EIP-155](https://eips.ethereum.org/EIPS/eip-155).
  If not present, it MUST default to 1 (mainnet).

  'opts' is defined in
  [Section 2 of RFC 8905](https://tools.ietf.org/html/rfc8905#section-2).


Examples:

      payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1
      payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1@11155111
      payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1?amount=1.23
      payto://eth/0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1?amount=0x6b175474e89094c44da98b954eedeac495271d0f:1.23
    
    The first address requests that payment be sent to the
    mainnet address '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.

    The second address requests that payment be sent to the
    Sepolia testnet address
    '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.

    The third address requests that 1.23 ETH (1230000000000000000
    wei) be sent to the mainnet address
    '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.

    The fourth address requests that 1.23 DAI (1230000000000000000
    base units of DAI, since DAI has 18 ERC-20 decimals) be sent
    to the mainnet address '0x84af3D5824F0390b9510440B6ABB5CC02BB68ea1'.


Motivation - not normative

This syntax is modeled after the ERC-681 URL format
for transaction requests, commonly used in Ethereum
wallets and DApps. The function and function parameters
are not included in this URI type, since they are not
needed for payment requests.

The chain ID is included in the URI, to prevent replay
attacks between different chains. The checksum address
is included in the URI, to prevent typos and other
errors in the address. The checksum address is also
included in the URI, to prevent phishing attacks by
displaying the address in a different case than the
one used to create the address.

The currency is included in the URI, to allow payments
to be made in any ERC-20 token. Three-letter currency
codes are not included, since they are not valid ERC-20
token addresses. Should sending traditional currencies
be desired, Stablecoins are often ERC-20 tokens, and are
therefore valid currencies for this URI type.


Contact:  <gavinnjohn@gmail.com>


Normative References

* [ERC-20] Token Standard
  <https://eips.ethereum.org/EIPS/eip-20>

* [ERC-55] Mixed-case checksum address encoding
  <https://eips.ethereum.org/EIPS/eip-55>

* [EIP-155] Simple replay attack protection
  <https://eips.ethereum.org/EIPS/eip-155>

* [RFC 8905] The 'payto' URI Scheme for Payments
  <https://tools.ietf.org/html/rfc8905>

Informative References

* [EIP-681] URL Format for Transaction Requests
  <https://eips.ethereum.org/EIPS/eip-681>