-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
EIP: Payment request URL specification #681
Merged
Merged
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
640a8a7
EIP: Payment request URL specification for QR codes, hyperlinks and A…
b7f8744
EIP: Add ENS support to payment requests
56a2454
EIP: Explicit disclaimer for hexadecimal addresses taking priority ov…
1546a48
EIP: Explicit reference to ERC #67 added. Protocol part changed to "e…
2b8a160
EIP: Removed #67 from requirements. It is not required, merely refere…
6845ceb
EIP: Major overhaul, taking into account the feedback received. In pa…
fcc7b9e
EIP: fixes missing s/ethpay/ethereum
ab76063
EIP: Added the possibility of using a unit.
nagydani afe03e7
ERC: Added chain_id
nagydani 7eff557
ERC: versioning
nagydani e035471
ERC: We are 681
nagydani 4eca54f
ERC: Corrected numbering typo and renamed file
nagydani b5444e4
Update eip-681.md
nagydani f4ba09d
[EIP] Optional pay- prefix.
nagydani 1bc54d9
Added copyright notice, removed ERC 76 dependency
nagydani 7e33495
[ERC] Clarified gas and added 831 as a dependency.
nagydani 991d4f7
[ERC] Fixes Compatibility and Versioning
nagydani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## Preamble | ||
|
||
EIP: <to be assigned> | ||
Title: URL Format for Payment Requests | ||
Author: Daniel A. Nagy <[email protected]> | ||
Type: Standard Track | ||
Category: ERC | ||
Status: Draft | ||
Created: 2017-08-01 | ||
Requires: #20, #67, #137 | ||
|
||
## Simple Summary | ||
A standard way of representing payment requests in Ethers and ERC #20 tokens as URLs. | ||
|
||
## 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. | ||
|
||
## Motivation | ||
The convenience of representing payment requests by standard URLs has been a major factor in the wide adoption of Bitcoin. Bringing a similarly convenient mechanism to Ethereum would speed up its acceptance as a payment platform among end-users. In particular, URLs embedded in broadcast Intents are the preferred way of launching applications on the Android operating system and work across practically all applications. Desktop web browsers have a standardized way of defining protocol handlers for URLs with specific protocol specifications. Other desktop applications typically launch the web browser upon encountering a URL. Thus, payment request URLs could be delivered through a very broad, ever growing selection of channels. | ||
|
||
Note that this is different from ERC #67, which is a URL format for representing arbitrary transactions and as such is more general and low-level. This ERC deals specifically with the important special case of payment requests. | ||
|
||
## Specification | ||
|
||
### Syntax | ||
Payment request URLs contain "ethpay" in their schema (protocol) part and are constructed as follows: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean, it must contain "ethereum:" in their schema There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aw, shit! I knew I screwed up the squashing of all changes. |
||
|
||
request = "ethpay" ":" beneficiary_address [ "/" token_contract_address ] [ "?" parameters ] | ||
beneficiary_address = ethereum_address | ||
token_contract_address = ethereum_address | ||
ethereum_address = 40*40HEXDIG / ENS_NAME | ||
parameters = parameter *( "&" parameter ) | ||
parameter = key "=" value | ||
|
||
At present, the only `key` defined is `amount` and the corresponding `value` is a decimal number. Thus: | ||
|
||
key = "amount" | ||
value = *DIGIT [ "." 1*DIGIT ] | ||
|
||
For the syntax of ENS_NAME, please consult ERC #137 defining Ethereum Name Service. | ||
|
||
### Semantics | ||
If `token_contract_address` is missing, then the payment is requested in the native token of the blockchain, which is Ether in our case. The only mandatory field `beneficiary_address` denotes the address of the account to be credited with the requested token. | ||
|
||
Thus, if `token_contract_address` is missing, the target address of the transaction is `beneficiary_address`, otherwise it is `token_contract_address`, with the appropriate transaction data, as defined in ERC #20 indicating the transfer of the given amount of tokens. | ||
|
||
If using ENS names instead of hexadecimal addresses, the resolution is up to the payer, at any time between receiving the URL and sending the transaction. Hexadecimal addresses always take precedence over ENS names, i. e. even if there exists a matching ENS name consisting of 40 hexadecimal digits, it should never be resolved. Instead, the hexadecimal address should be used directly. | ||
|
||
The amount is to be interpreted in the decimal definition of the token, NOT the atomic unit. In case of Ether, it needs to be multiplied by 10^18 to get the integer amount in Wei. For other tokens, the decimal value should be read from the token contract before conversion. | ||
|
||
Note that the indicated amount is only a suggestion and the user is free to change it. With no indicated amount, the user should be prompted to enter the amount to be paid. In case of multiple suggestions, the user should have the option of choosing one or enter their own. | ||
|
||
## Rationale | ||
The proposed format is chosen to resemble `bitcoin:` URLs as closely as possible, as both users and application programmers are already familiar with that format. In particular, this motivated the omission of the unit, which is often used in Ethereum ecosystem. Handling different orders of magnitude is delegated to the application, just like in the case of `bitcoin:`. Additional parameters may be added, if popular use cases requiring them emerge in practice. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does it require ERC-67?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, it should not be required. It is merely referenced.