From 1d0c4ab09b9f328b2ac8d5656ace5e8746a7139a Mon Sep 17 00:00:00 2001 From: zancas Date: Thu, 7 Sep 2023 13:46:01 -0600 Subject: [PATCH] Separate out logical action contributions of each protocol for clarity. Co-authored-by: Zancas Signed-off-by: Daira-Emma Hopwood --- zip-0317.html | 18 ++++++++++++------ zip-0317.rst | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/zip-0317.html b/zip-0317.html index 25c198c7..edd511c0 100644 --- a/zip-0317.html +++ b/zip-0317.html @@ -118,12 +118,18 @@ Pull-Request: <https://githu

Wallets implementing this specification SHOULD use a conventional fee calculated in zatoshis per the following formula:

\(\begin{array}{rcl} - logical\_actions &=& \mathsf{max}\big(\mathsf{ceiling}\big(\frac{tx\_in\_total\_size}{p2pkh\_standard\_input\_size}\big), - \mathsf{ceiling}\big(\frac{tx\_out\_total\_size}{p2pkh\_standard\_output\_size}\big)\big) \;+ \\ - & & 2 \cdot nJoinSplit \;+ \\ - & & \mathsf{max}(nSpendsSapling, nOutputsSapling) \;+ \\ - & & nActionsOrchard \\ - conventional\_fee &=& marginal\_fee \cdot \mathsf{max}(grace\_actions, logical\_actions) + contribution_{\,\mathsf{Transparent}} &=& + \mathsf{max}\big(\mathsf{ceiling}\big(\frac{tx\_in\_total\_size}{p2pkh\_standard\_input\_size}\big),\, + \mathsf{ceiling}\big(\frac{tx\_out\_total\_size}{p2pkh\_standard\_output\_size}\big)\big) \\ + contribution_{\,\rlap{\mathsf{Sprout}}\phantom{\mathsf{Transparent}}} &=& 2 \cdot nJoinSplit \\ + contribution_{\,\rlap{\mathsf{Sapling}}\phantom{\mathsf{Transparent}}} &=& \mathsf{max}(nSpendsSapling,\, nOutputsSapling) \\ + contribution_{\,\rlap{\mathsf{Orchard}}\phantom{\mathsf{Transparent}}} &=& nActionsOrchard \\ + \\ + logical\_actions &=& contribution_{\,\mathsf{Transparent}} + + contribution_{\,\mathsf{Sprout}} + + contribution_{\,\mathsf{Sapling}} + + contribution_{\,\mathsf{Orchard}} \\ + conventional\_fee &=& marginal\_fee \cdot \mathsf{max}(grace\_actions,\, logical\_actions) \end{array}\)

The inputs to this formula are taken from transaction fields defined in the Zcash protocol specification 3:

diff --git a/zip-0317.rst b/zip-0317.rst index ef38249b..54dfce0e 100644 --- a/zip-0317.rst +++ b/zip-0317.rst @@ -113,12 +113,18 @@ calculated in zatoshis per the following formula: .. math:: \begin{array}{rcl} - logical\_actions &=& \mathsf{max}\big(\mathsf{ceiling}\big(\frac{tx\_in\_total\_size}{p2pkh\_standard\_input\_size}\big), - \mathsf{ceiling}\big(\frac{tx\_out\_total\_size}{p2pkh\_standard\_output\_size}\big)\big) \;+ \\ - & & 2 \cdot nJoinSplit \;+ \\ - & & \mathsf{max}(nSpendsSapling, nOutputsSapling) \;+ \\ - & & nActionsOrchard \\ - conventional\_fee &=& marginal\_fee \cdot \mathsf{max}(grace\_actions, logical\_actions) + contribution_{\,\mathsf{Transparent}} &=& + \mathsf{max}\big(\mathsf{ceiling}\big(\frac{tx\_in\_total\_size}{p2pkh\_standard\_input\_size}\big),\, + \mathsf{ceiling}\big(\frac{tx\_out\_total\_size}{p2pkh\_standard\_output\_size}\big)\big) \\ + contribution_{\,\rlap{\mathsf{Sprout}}\phantom{\mathsf{Transparent}}} &=& 2 \cdot nJoinSplit \\ + contribution_{\,\rlap{\mathsf{Sapling}}\phantom{\mathsf{Transparent}}} &=& \mathsf{max}(nSpendsSapling,\, nOutputsSapling) \\ + contribution_{\,\rlap{\mathsf{Orchard}}\phantom{\mathsf{Transparent}}} &=& nActionsOrchard \\ + \\ + logical\_actions &=& contribution_{\,\mathsf{Transparent}} + + contribution_{\,\mathsf{Sprout}} + + contribution_{\,\mathsf{Sapling}} + + contribution_{\,\mathsf{Orchard}} \\ + conventional\_fee &=& marginal\_fee \cdot \mathsf{max}(grace\_actions,\, logical\_actions) \end{array} The inputs to this formula are taken from transaction fields defined in the Zcash protocol