diff --git a/README.rst b/README.rst index 79183863e..06eb4c577 100644 --- a/README.rst +++ b/README.rst @@ -170,6 +170,7 @@ be deleted. + diff --git a/rendered/draft-ecc-explicit-fees.html b/rendered/draft-ecc-explicit-fees.html new file mode 100644 index 000000000..ed10ec5b7 --- /dev/null +++ b/rendered/draft-ecc-explicit-fees.html @@ -0,0 +1,169 @@ + + + + Draft ecc-explicit-fees: Explicit Fees + + + + +
+
ZIP: Unassigned
+Title: Explicit Fees
+Owners: Daira-Emma Hopwood <daira-emma@electriccoin.co>
+        Kris Nuttycombe <kris@electriccoin.co>
+        Jack Grigg <jack@electriccoin.co>
+Credits: Simon Liu
+Status: Draft
+Category: Consensus
+License: MIT
+Discussions-To: <https://github.com/zcash/zips/issues/803>
+Pull-Request: <https://github.com/zcash/zips/pull/919>
+

Terminology

+

The key word "MUST" in this document is to be interpreted as described in BCP 14 1 when, and only when, it appears in all capitals.

+

The character § is used when referring to sections of the Zcash Protocol Specification 2.

+
+

Abstract

+

This proposal adds an explicit fee field to the v6 transaction format. Instead of fees being implicit in the difference between the input value and output value of the transaction, all value transfers, including fee transfers to miners, will be explicit and committed to via the txid.

+
+

Motivation

+

When it comes to fee selection, it should be very hard to make mistakes. The current transparent fee computation (inherited from Bitcoin) — input value less output value — is prone to user error. It is very easy to forget to add an output for a change address, make a calculation error 5, mix up units etc.

+

In addition, when signing a transaction with a hardware wallet, using an implicit fee means that the hardware wallet must recompute the fee on its own and cannot simply display the value being committed to.

+

Finally, this change will make it possible for light clients to determine the fee paid by a transaction without needing to download and inspect transparent inputs to the transaction.

+
+

Requirements

+

There must not be any potentially error-prone calculations needed to compute the fee for a given transaction. That is, the fee must be obvious from the encoding of the transaction.

+
+

Specification

+

Transaction Format

+

The following field is added to the v6 transaction format 6.

+
Title
Explicit Fees
Manufacturing Consent; Re-Establishing a Dev Fund for ECC, ZF, ZCG, Qedit, FPF, and ZecHub
Block Reward Allocation for Non-Direct Development Funding
Establishing a Hybrid Dev Fund for ZF, ZCG and a Dev Fund Reserve
+ + + + + + + + + + + + + + + + +
BytesNameData TypeDescription
8feeuint64The fee to be paid by this transaction, in zatoshis.
+ +

Consensus Rules

+

The following changes are to be made to the Zcash Protocol Specification 2.

+

In § 3.4 ‘Transactions and Treestates’ 3 (last modified by ZIP 236 7), add the following consensus rule and note:

+
+ +

Non-normative note: The effect of these rules is that the fee field of v6 and later coinbase transactions will always be zero.

+
+

In § 7.1 ‘Transaction Encoding and Consensus’ 4, add:

+
+

[NU7 onward] fee MUST be in the range + \(\{ 0 .. \mathsf{MAX\_MONEY} \}\) + .

+
+
+

Signature Hash

+

The transaction signature hashing algorithm defined in ZIP 244 is to be modified for v6 transactions as follows:

+

Section T.1: header_digest 8 is specified in draft-txv6-sighash 9 to read:

+
+

A BLAKE2b-256 hash of the following values

+
T.1a: version             (4-byte little-endian version identifier including ``fOverwintered`` flag)
+T.1b: version_group_id    (4-byte little-endian version group identifier)
+T.1c: consensus_branch_id (4-byte little-endian consensus branch id)
+T.1d: lock_time           (4-byte little-endian ``nLockTime`` value)
+T.1e: expiry_height       (4-byte little-endian block height)
+T.1f: fee                 (8-byte little-endian fee value)
+

The personalization field of this hash is set to:

+
"ZTxIdHeadersHash"
+
+
+ +

Reference implementation

+

TBD

+
+

References

+ + + + + + + +
1Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"
+ + + + + + + +
2Zcash Protocol Specification, Version 2024.5.1 [NU6] or later
+ + + + + + + +
3Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions and Treestates
+ + + + + + + +
4Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1.2: Transaction Consensus Rules
+ + + + + + + +
5Bitcoin Forum post by @Voiceeeeee, March 8, 2017. "PLEASE HELP.. I sent a transaction with a 2.5 BTC transaction fee"
+ + + + + + + +
6ZIP 230: Version 6 Transaction Format
+ + + + + + + +
7ZIP 236: Blocks should balance exactly
+ + + + + + + +
8ZIP 244: Transaction Identifier Non-Malleability. Section T.1: Header Digest
+ + + + + + + +
9ZIP draft: Version 6 Transaction Signature Validation
+
+ + + \ No newline at end of file diff --git a/rendered/index.html b/rendered/index.html index 4837413ba..511752d06 100644 --- a/rendered/index.html +++ b/rendered/index.html @@ -126,6 +126,7 @@

These are works-in-progress, and may never be assigned ZIP numbers if their ideas become obsoleted or abandoned. Do not assume that these drafts will exist in perpetuity; instead assume that they will either move to a numbered ZIP, or be deleted.

+ diff --git a/zips/draft-ecc-explicit-fees.rst b/zips/draft-ecc-explicit-fees.rst new file mode 100644 index 000000000..66a1c2515 --- /dev/null +++ b/zips/draft-ecc-explicit-fees.rst @@ -0,0 +1,134 @@ +:: + + ZIP: Unassigned + Title: Explicit Fees + Owners: Daira-Emma Hopwood + Kris Nuttycombe + Jack Grigg + Credits: Simon Liu + Status: Draft + Category: Consensus + License: MIT + Discussions-To: + Pull-Request: + + +Terminology +=========== + +The key word "MUST" in this document is to be interpreted as described in BCP 14 [#BCP14]_ +when, and only when, it appears in all capitals. + +The character § is used when referring to sections of the Zcash Protocol Specification +[#protocol]_. + + +Abstract +======== + +This proposal adds an explicit ``fee`` field to the v6 transaction format. +Instead of fees being implicit in the difference between the input value and +output value of the transaction, all value transfers, including fee transfers to +miners, will be explicit and committed to via the txid. + + +Motivation +========== + +When it comes to fee selection, it should be very hard to make mistakes. +The current transparent fee computation (inherited from Bitcoin) — input value +less output value — is prone to user error. It is very easy to forget to add an +output for a change address, make a calculation error [#bitcointalk-fee-error]_, +mix up units etc. + +In addition, when signing a transaction with a hardware wallet, using an implicit +fee means that the hardware wallet must recompute the fee on its own and cannot +simply display the value being committed to. + +Finally, this change will make it possible for light clients to determine the +fee paid by a transaction without needing to download and inspect transparent +inputs to the transaction. + + +Requirements +============ + +There must not be any potentially error-prone calculations needed to compute the +fee for a given transaction. That is, the fee must be obvious from the encoding +of the transaction. + + +Specification +============= + +Transaction Format +------------------ + +The following field is added to the v6 transaction format [#zip-0230-transaction-format]_. + ++-------+---------+------------+------------------------------------------------------+ +| Bytes | Name | Data Type | Description | ++=======+=========+============+======================================================+ +| 8 | ``fee`` | ``uint64`` | The fee to be paid by this transaction, in zatoshis. | ++-------+---------+------------+------------------------------------------------------+ + +Consensus Rules +--------------- + +The following changes are to be made to the Zcash Protocol Specification [#protocol]_. + +In § 3.4 ‘Transactions and Treestates’ [#protocol-transactions]_ (last modified by +ZIP 236 [#zip-0236]_), add the following consensus rule and note: + + * [NU7 onward] For v6 and later transactions, the remaining value in the + transparent transaction value pool, in zatoshis, MUST be equal to the value + of the transaction’s ``fee`` field. + + Non-normative note: The effect of these rules is that the ``fee`` field of + v6 and later coinbase transactions will always be zero. + +In § 7.1 ‘Transaction Encoding and Consensus’ [#protocol-txnconsensus]_, add: + + [NU7 onward] ``fee`` MUST be in the range :math:`\{ 0 .. \mathsf{MAX\_MONEY} \}`. + +Signature Hash +-------------- + +The transaction signature hashing algorithm defined in ZIP 244 is to be modified +for v6 transactions as follows: + +Section T.1: `header_digest` [#zip-0244-header-digest]_ is specified in +`draft-txv6-sighash` [#draft-txv6-sighash]_ to read: + + A BLAKE2b-256 hash of the following values :: + + T.1a: version (4-byte little-endian version identifier including ``fOverwintered`` flag) + T.1b: version_group_id (4-byte little-endian version group identifier) + T.1c: consensus_branch_id (4-byte little-endian consensus branch id) + T.1d: lock_time (4-byte little-endian ``nLockTime`` value) + T.1e: expiry_height (4-byte little-endian block height) + T.1f: fee (8-byte little-endian fee value) + + The personalization field of this hash is set to:: + + "ZTxIdHeadersHash" + + +Reference implementation +======================== + +TBD + + +References +========== + +.. [#BCP14] `Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words" `_ +.. [#protocol] `Zcash Protocol Specification, Version 2024.5.1 [NU6] or later `_ +.. [#protocol-transactions] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 3.4: Transactions and Treestates `_ +.. [#protocol-txnconsensus] `Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 7.1.2: Transaction Consensus Rules `_ +.. [#bitcointalk-fee-error] `Bitcoin Forum post by @Voiceeeeee, March 8, 2017. "PLEASE HELP.. I sent a transaction with a 2.5 BTC transaction fee" `_ +.. [#zip-0230-transaction-format] `ZIP 230: Version 6 Transaction Format `_ +.. [#zip-0236] `ZIP 236: Blocks should balance exactly `_ +.. [#zip-0244-header-digest] `ZIP 244: Transaction Identifier Non-Malleability. Section T.1: Header Digest `_ +.. [#draft-txv6-sighash] `ZIP draft: Version 6 Transaction Signature Validation `_
Title
Explicit Fees
Manufacturing Consent; Re-Establishing a Dev Fund for ECC, ZF, ZCG, Qedit, FPF, and ZecHub
Block Reward Allocation for Non-Direct Development Funding
Establishing a Hybrid Dev Fund for ZF, ZCG and a Dev Fund Reserve