From 9d6684aa5becc3b35a8f2d703fd2601dc2ea7d27 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Tue, 6 Oct 2020 17:20:41 -0600 Subject: [PATCH 1/3] Clarify "payment" naming, purpose of the "label" field. --- zip-0321.html | 18 ++++++++++-------- zip-0321.rst | 31 +++++++++++++++++++------------ 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/zip-0321.html b/zip-0321.html index 24568862..68723122 100644 --- a/zip-0321.html +++ b/zip-0321.html @@ -22,17 +22,19 @@ License: MIT

The terms below are to be interpreted as follows:

payment
-
A transfer of funds implemented by a shielded or transparent output of a single Zcash transaction.
+
A transfer of funds implemented by a shielded or transparent output of a Zcash transaction.
+
payment request
+
A request for a wallet to construct a single Zcash transaction containing one or more payments.

Abstract

-

This ZIP proposes a standard format for payment request URIs. Wallets that recognize this format enable users to construct payments simply by clicking links on webpages or scanning QR codes.

+

This ZIP proposes a standard format for payment request URIs. Wallets that recognize this format enable users to construct transactions simply by clicking links on webpages or scanning QR codes.

Motivation

In order for a robust transactional ecosystem to evolve for Zcash, it is necessary for vendors to be able to issue requests for payment. At present, the best option available is to manually specify a payment address, a payment amount, and potentially memo field content. Of these three components, existing wallets only provide functionality for reading payment addresses in a semi-automated fashion. It is then necessary for the user to manually enter payment amounts and any associated memo information, which is tedious and may be error-prone, particularly if a payment is intended for multiple recipients or the memo field information contains structured data that must be faithfully reproduced.

-

This ZIP seeks to eliminate these issues by proposing a standard format that wallet vendors may support so that human intervention is required only for approval, not creation, of such a payment transaction.

-

In Bitcoin, two different standards exist to permit vendors to issue payment requests that are understood by wallets: BIP-0021 5 and BIP-0070 6. BIP-0021 provides a URI format that can be interpreted by a wallet to construct simple, single-recipient transactions; while BIP-0070 uses a protobuf-based protocol that permits payment requests to specify the creation of transactions of arbitrary complexity.

-

The format proposed in this ZIP seeks a middle ground between these approaches: to provide a URI-based format which supports both the trivial use case and the slightly-more-complex situation where a payment may be intended for multiple recipients.

+

This ZIP seeks to eliminate these issues by proposing a standard format that wallet vendors may support so that human intervention is required only for approval, not creation, of such a transaction.

+

In Bitcoin, two different standards exist to permit vendors to issue payment requests that are understood by wallets: BIP-0021 5 and BIP-0070 6. BIP-0021 provides a URI format that can be interpreted by a wallet to construct simple, single-recipient transactions; BIP-0070 uses a protobuf-based protocol that permits requests for transactions of arbitrary complexity.

+

The format proposed in this ZIP seeks a middle ground between these approaches: to provide a URI-based format which supports both the trivial use case and the slightly-more-complex situation where a transaction may include payments to multiple recipients.

Requirements

The format must be a valid URI.

@@ -74,7 +76,7 @@ License: MIT
  • a Zcash Sapling address, using Bech32 8 as defined in 13.
  • New address formats may be added in future. If the context of whether the payment URI is intended for Testnet or Mainnet is available, then each address SHOULD be checked to be for the correct network.

    -

    Sprout addresses MUST NOT be supported in payment requests. The rationale for this is that transfers to Sprout addresses will, at activation of the Canopy network upgrade, be restricted by ZIP 211 9; and it cannot generally be expected that senders will have funds available in the Sprout pool with which to satisfy requests for payment to a Sprout address.

    +

    Sprout addresses MUST NOT be supported in payment requests. The rationale for this is that transfers to Sprout addresses will, at activation of the Canopy network upgrade, be restricted by ZIP 211 9; it cannot generally be expected that senders will have funds available in the Sprout pool with which to satisfy requests for payment to a Sprout address.

    Transfer amount

    If an amount is provided, it MUST be specified in decimal ZEC. If a decimal fraction is present then a period (.) MUST be used as the separating character to separate the whole number from the decimal fraction, and both the whole number and the decimal fraction MUST be nonempty. No other separators (such as commas for grouping or thousands) are permitted. Leading zeros in the whole number or trailing zeros in the decimal fraction are ignored. There MUST NOT be more than 8 digits in the decimal fraction.

    @@ -93,13 +95,13 @@ License: MIT

    Query Keys

    label
    -
    Label for an address (e.g. name of receiver)
    +
    Label for an address (e.g. name of receiver). If a label is present at a paramindex, a client rendering a payment for inspection by the user SHOULD preferentially display this label instead of the associated address (the client MUST still make it possible for the user to see the actual address to which the payment will be directed.)
    address
    Zcash address string (shielded or transparent)
    memo
    Contents for the Zcash shielded memo field, encoded as base64url without = padding. The decoded memo contents MUST NOT exceed 512 bytes, and if shorter, will be filled with trailing zeros to 512 bytes. Parsers MUST consider the entire URI invalid if the address associated with the same paramindex is not a valid shielded address.
    message
    -
    Message that clients can display for the purpose of presenting descriptive information about the transaction to the user.
    +
    Message that clients can display for the purpose of presenting descriptive information about the payment at the associated paramindex to the user.

    Examples

    diff --git a/zip-0321.rst b/zip-0321.rst index 987a6850..1f7ee129 100644 --- a/zip-0321.rst +++ b/zip-0321.rst @@ -24,15 +24,18 @@ section 3.11 of the Zcash Protocol Specification [#protocol-networks]_. The terms below are to be interpreted as follows: payment - A transfer of funds implemented by a shielded or transparent output of - a single Zcash transaction. + A transfer of funds implemented by a shielded or transparent output of a Zcash + transaction. +payment request + A request for a wallet to construct a single Zcash transaction containing one or + more payments. Abstract ======== This ZIP proposes a standard format for payment request URIs. Wallets that -recognize this format enable users to construct payments simply by +recognize this format enable users to construct transactions simply by clicking links on webpages or scanning QR codes. @@ -52,18 +55,18 @@ reproduced. This ZIP seeks to eliminate these issues by proposing a standard format that wallet vendors may support so that human intervention is required only for -approval, not creation, of such a payment transaction. +approval, not creation, of such a transaction. In Bitcoin, two different standards exist to permit vendors to issue payment requests that are understood by wallets: BIP-0021 [#bip-0021]_ and BIP-0070 [#bip-0070]_. BIP-0021 provides a URI format that can be interpreted by a -wallet to construct simple, single-recipient transactions; while BIP-0070 uses a -protobuf-based protocol that permits payment requests to specify the creation -of transactions of arbitrary complexity. +wallet to construct simple, single-recipient transactions; BIP-0070 uses a +protobuf-based protocol that permits requests for transactions of arbitrary +complexity. The format proposed in this ZIP seeks a middle ground between these approaches: to provide a URI-based format which supports both the trivial use case and -the slightly-more-complex situation where a payment may be intended for +the slightly-more-complex situation where a transaction may include payments to multiple recipients. @@ -160,7 +163,7 @@ SHOULD be checked to be for the correct network. Sprout addresses MUST NOT be supported in payment requests. The rationale for this is that transfers to Sprout addresses will, at activation of the Canopy -network upgrade, be restricted by ZIP 211 [#zip-0211]_; and it cannot generally +network upgrade, be restricted by ZIP 211 [#zip-0211]_; it cannot generally be expected that senders will have funds available in the Sprout pool with which to satisfy requests for payment to a Sprout address. @@ -188,7 +191,11 @@ Query Keys ---------- label - Label for an address (e.g. name of receiver) + Label for an address (e.g. name of receiver). If a label is present at + a ``paramindex``, a client rendering a payment for inspection by the user + SHOULD preferentially display this label instead of the associated + address (the client MUST still make it possible for the user to see the + actual address to which the payment will be directed.) address Zcash address string (shielded or transparent) @@ -198,11 +205,11 @@ memo ``=`` padding. The decoded memo contents MUST NOT exceed 512 bytes, and if shorter, will be filled with trailing zeros to 512 bytes. Parsers MUST consider the entire URI invalid if the address associated with - the same ``paramindex`` is not a valid shielded address. + the same ``paramindex`` is not a valid shielded address. message Message that clients can display for the purpose of presenting descriptive - information about the transaction to the user. + information about the payment at the associated ``paramindex`` to the user. Examples -------- From 3327bdd2dcf53d19c7a73db23b90aa4cb31f24c0 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 7 Oct 2020 08:13:40 -0600 Subject: [PATCH 2/3] Update zip-0321.rst Co-authored-by: Daira Hopwood --- zip-0321.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zip-0321.rst b/zip-0321.rst index 1f7ee129..bf51d657 100644 --- a/zip-0321.rst +++ b/zip-0321.rst @@ -193,9 +193,8 @@ Query Keys label Label for an address (e.g. name of receiver). If a label is present at a ``paramindex``, a client rendering a payment for inspection by the user - SHOULD preferentially display this label instead of the associated - address (the client MUST still make it possible for the user to see the - actual address to which the payment will be directed.) + SHOULD display this label (if possible) as well as the associated address. + If the label is displayed, it MUST be identifiable as distinct from the address. address Zcash address string (shielded or transparent) From 15f8fb70aca1f7d856140bfdf04b118bc82eb02a Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 7 Oct 2020 15:21:39 +0100 Subject: [PATCH 3/3] ZIP 321: regenerate HTML. Signed-off-by: Daira Hopwood --- zip-0321.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0321.html b/zip-0321.html index 68723122..a1e4eaed 100644 --- a/zip-0321.html +++ b/zip-0321.html @@ -95,7 +95,7 @@ License: MIT

    Query Keys

    label
    -
    Label for an address (e.g. name of receiver). If a label is present at a paramindex, a client rendering a payment for inspection by the user SHOULD preferentially display this label instead of the associated address (the client MUST still make it possible for the user to see the actual address to which the payment will be directed.)
    +
    Label for an address (e.g. name of receiver). If a label is present at a paramindex, a client rendering a payment for inspection by the user SHOULD display this label (if possible) as well as the associated address. If the label is displayed, it MUST be identifiable as distinct from the address.
    address
    Zcash address string (shielded or transparent)
    memo