-
Notifications
You must be signed in to change notification settings - Fork 159
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
[ZIP-230] v6 transactions, including ZSAs #687
Conversation
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``varies`` |``nSpendsSapling`` |``compactSize`` |Number of Sapling Spend descriptions in ``vSpendsSapling``. | | ||
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``96 * nSpendsSapling`` |``vSpendsSapling`` |``SpendDescriptionV6[nSpendsSapling]`` |A sequence of Sapling Spend descriptions, encoded per | |
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.
|``96 * nSpendsSapling`` |``vSpendsSapling`` |``SpendDescriptionV6[nSpendsSapling]`` |A sequence of Sapling Spend descriptions, encoded per | | |
|``96 * nSpendsSapling`` |``vSpendsSapling`` |``SpendDescriptionV5[nSpendsSapling]`` |A sequence of Sapling Spend descriptions, encoded per | |
There's no reason for this to be different from v5. We can add a note explaining that.
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``varies`` |``nOutputsSapling`` |``compactSize`` |Number of Sapling Output Decriptions in ``vOutputsSapling``. | | ||
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``756 * nOutputsSapling`` |``vOutputsSapling`` |``OutputDescriptionV6[nOutputsSapling]``|A sequence of Sapling Output descriptions, encoded per | |
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.
|``756 * nOutputsSapling`` |``vOutputsSapling`` |``OutputDescriptionV6[nOutputsSapling]``|A sequence of Sapling Output descriptions, encoded per | | |
|``756 * nOutputsSapling`` |``vOutputsSapling`` |``OutputDescriptionV5[nOutputsSapling]``|A sequence of Sapling Output descriptions, encoded per | |
Co-authored-by: Daira Hopwood <[email protected]>
Co-authored-by: Daira Hopwood <[email protected]>
Co-authored-by: Daira Hopwood <[email protected]>
+-----------------------------+--------------------------+--------------------------------------+------------------------------------------------------------+ | ||
|``32`` |``ephemeralKey`` |``byte[32]`` |An encoding of an ephemeral Jubjub public key. | | ||
+-----------------------------+--------------------------+--------------------------------------+------------------------------------------------------------+ | ||
|``580`` |``encCiphertext`` |``byte[580]`` |The encrypted contents of the note plaintext. | |
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.
Something that I wanted to get in for v5 transactions, but that we didn't do because we were already pushing the complexity budget, is decouple memos from outputs. The idea here is that the action would, instead of a memo in the encCiphertext, include a 32-byte key. The transaction would then, at the top level, contain a field that is a length-prefixed array of 512-byte memo ciphertexts. This would allow multiple memos to be decryptable by a single recipient, or a single memo to be decrypted by multiple recipients without increasing the size of the transaction, or any combination in between. Decoupling the memos from the outputs could open up new use cases for including longer message, and could also in common cases limit chain growth by eliminating the need to add an additional 512-byte payload for each recipient; the "standard" would likely be to include a single memo per transaction. At present, if a user wants to send more than a single 512-byte payload to their counterparty, they are compelled to bloat the chain with extra actions; segregating the memos eliminates this source of chain growth.
If we did decouple the memos in this fashion, we'd probably want to modify ZIP 317 to add a per-memo fee amount (potentially decreasing the marginal fee per action at the same time).
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.
Oops, I'd meant to put this comment into the Orchard section, but I suppose that it could apply to Sapling as well.
zip-xxxx.rst
Outdated
@@ -0,0 +1,290 @@ | |||
:: | |||
|
|||
ZIP: XXXX |
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.
ZIP number reserved: 230
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``4`` |``lock_time`` |``uint32`` |Unix-epoch UTC time or block height, encoded as in Bitcoin. | | ||
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``4`` |``nExpiryHeight`` |``uint32`` |A block height in the range {1 .. 499999999} after which | |
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.
Do we want to specify coinbase transaction heights here, or is it ok to leave it in the detailed rules?
| | | |the transaction will expire, or 0 to disable expiry. | | ||
| | | |[ZIP-203] | | ||
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``8`` |``fee`` |``int64`` |The fee to be paid by this transaction, in zatoshis. | |
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.
|``8`` |``fee`` |``int64`` |The fee to be paid by this transaction, in zatoshis. | | |
|``8`` |``fee`` |``int64`` |The non-negative fee to be paid by this transaction, in zatoshis. | |
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.
Or are negative values allowed in coinbase transactions?
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.
Teor's comment refers to a brainwave I had during the ZIP sync today, which is that a negative fee in a coinbase transaction could represent the fees collected from other transactions in the block. This would be more regular, because:
- every transaction would balance exactly;
- the sum of
fee
fields in each block would be zero.
| | | |the transaction will expire, or 0 to disable expiry. | | ||
| | | |[ZIP-203] | | ||
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``8`` |``fee`` |``int64`` |The fee to be paid by this transaction, in zatoshis. | |
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.
Is it worth making the fees and value balances a CompactSize to save 15+ bytes per transaction?
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.
I have no strong opinion about this, but a possible argument for doing so is that if we increase the range of amounts in order to accommodate ZSA bridges with other coins that have a larger range, then using CompactSizes would help to mitigate the cost of that (when the full range is not actually used, or for ZEC).
Co-authored-by: teor <[email protected]>
Co-authored-by: teor <[email protected]>
A note from zip sync: we should start thinking about setting a horizon for recovery of notes and memos from the chain via trial decryption. 10 years maybe? |
| | | |the transaction will expire, or 0 to disable expiry. | | ||
| | | |[ZIP-203] | | ||
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | ||
|``8`` |``fee`` |``int64`` |The fee to be paid by this transaction, in zatoshis. | |
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.
Suggestion: add a burn_value
field (values treated as burned may eventually be contributed to the sustainability fund) and then add a consensus rule that all transactions are required to fully balance.
I've pushed #745 to add |
This was subsumed by (and appears to have been copied into) #778 |
fixes #686