# URI Scheme Specificaton
# Version: 0.3
# Date published: 1-18-2019
The purpose of this URI scheme is to enable users to easily make SLP token & Bitcoin Cash payments by simply clicking links on webpages or scanning QR Codes.
# General rules for handling (important!)
SLP clients MUST NOT act on URIs without getting the user's authorization. They SHOULD require the user to manually approve each payment individually, though in some cases they MAY allow the user to automatically make this decision.
# Operating system integration
Graphical SLP clients SHOULD register themselves as the handler for the "simpleledger:" URI scheme by default, if no other handler is already registered. If there is already a registered handler, they MAY prompt the user to change it once when they first run the client.
# General Format
SLP URIs follow the general format for URIs as set forth in RFC 3986. The path component consists of a simpleledger address, and the query component provides additional payment options.
Elements of the query component may contain characters outside the valid range. These must first be encoded according to UTF-8, and then each octet of the corresponding UTF-8 sequence must be percent-encoded as described in RFC 3986.
# ABNF grammar
slpurn = "simpleledger:" [ address / cashsigndata ] [ "?" params ] address = *slpaddr params = param [ "&" params ] param = [ amountparam / multiamounts / labelparam / messageparam / otherparam / reqparam / cashsign-type / cashsign-data / cashsign-callbackurl ] amountparam = "amount=" *digit [ "." *digit ] [ tokenid ] multiamounts = multiamount [ "&" multiamounts ] multiamount = "amount" *uniquechar "=" *digit [ "." *digit ] [ tokenid ] | tokenid = "-" 64*hexchar [ "-" tokenflags ] tokenflags = tokenflag [ "-" tokenflags ] tokenflag = [ "isgroup" / *qchar ] labelparam = "label=" *qchar messageparam = "message=" *qchar cashsign-type = [ utf8 / bytes / txn ] cashsign-data = "0x" *hexchar cashsign-callbackurl = "https://" *qchar otherparam = qchar *qchar [ "=" *qchar ] reqparam = "req-" qchar *qchar [ "=" *qchar ]
# Implementation Requirements
- Bitcoin Cash is the blockchain associated with the "simpleledger" URI scheme.
tokenflagsis omitted the payment shall be made using the tokenid specified. However, if the
isgrouptokenflag option is provided then the payment request can satisfied using any valid NFT originating from the NFT group tokenid provided. Read NFT group specification here for more information. In the future additional
tokenflagoptions may be possible.
- The character set requirements for the
*slpaddraddress format are specified here.
This section is non-normative and does not cover all possible syntax. Please see the BNF grammar above for the normative syntax.
Just the address:
Address with name:
Request 10.0001 XYZ tokens to "Satoshi-Nakamoto":
Request 20.30 BCH & 1000 XYZ tokens to "Satoshi-Nakamoto":
Request 50 BCH & 1 ABC token with message:
Request any 1 NFT token from group XYZ (using "isgroup"):
Some future version that has variables which are (currently) not understood and required and thus invalid:
Some future version that has variables which are (currently) not understood but not required and thus valid:
cashsign in the parameter names in the hope that wallets which do not yet support CashSign will be able to show the user an error message regarding the parameter "cashsign-X" not being supported.
cashsign-type: can be message (utf8, bytes) or transaction (txn), more can be added in future
cashsign-data: contains the payload, can be a message or a transaction. prefixed with 0x
cashsign-callbackurl: url for the wallet to post the signed data back to.
- Sign arbitrary message
Will allow for user to see this data in wallet:
Request for signing message (Provide confirmation and cancel box)
Inform user that this data will be signed and returned to $cashsign-callbackurl
This should be UTF-8 and the message should be shown in a textbox for the user to inspect.
Will allow for user to see a graphical representation of a transaction and be able to sign some or all of the inputs.
Request for signing transaction (Provide confirmation and cancel box)
Inform user that the transaction will be signed and returned to $cashsign-callbackurl
Show a transaction renderer with the following properties:
Our own inputs must be colored
Our own outputs must be colored similarly
Our change should be visible so that users can easily see how much they are actually spending.
# Reference Implementations
- Electron Cash SLP
- SLPJS Utils.parseSlpUri()