mirror of https://github.com/zcash/zips.git
517 lines
80 KiB
HTML
517 lines
80 KiB
HTML
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="generator" content="pandoc" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
|
<title>ZIP 243: Transaction Signature Verification for Sapling</title>
|
|
<style type="text/css">
|
|
code{white-space: pre-wrap;}
|
|
span.smallcaps{font-variant: small-caps;}
|
|
span.underline{text-decoration: underline;}
|
|
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
|
</style>
|
|
<style type="text/css">
|
|
a.sourceLine { display: inline-block; line-height: 1.25; }
|
|
a.sourceLine { pointer-events: none; color: inherit; text-decoration: inherit; }
|
|
a.sourceLine:empty { height: 1.2em; }
|
|
.sourceCode { overflow: visible; }
|
|
code.sourceCode { white-space: pre; position: relative; }
|
|
div.sourceCode { margin: 1em 0; }
|
|
pre.sourceCode { margin: 0; }
|
|
@media screen {
|
|
div.sourceCode { overflow: auto; }
|
|
}
|
|
@media print {
|
|
code.sourceCode { white-space: pre-wrap; }
|
|
a.sourceLine { text-indent: -1em; padding-left: 1em; }
|
|
}
|
|
pre.numberSource a.sourceLine
|
|
{ position: relative; left: -4em; }
|
|
pre.numberSource a.sourceLine::before
|
|
{ content: attr(title);
|
|
position: relative; left: -1em; text-align: right; vertical-align: baseline;
|
|
border: none; pointer-events: all; display: inline-block;
|
|
-webkit-touch-callout: none; -webkit-user-select: none;
|
|
-khtml-user-select: none; -moz-user-select: none;
|
|
-ms-user-select: none; user-select: none;
|
|
padding: 0 4px; width: 4em;
|
|
color: #aaaaaa;
|
|
}
|
|
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
|
|
div.sourceCode
|
|
{ }
|
|
@media screen {
|
|
a.sourceLine::before { text-decoration: underline; }
|
|
}
|
|
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
|
|
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
|
|
code span.at { color: #7d9029; } /* Attribute */
|
|
code span.bn { color: #40a070; } /* BaseN */
|
|
code span.bu { } /* BuiltIn */
|
|
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
|
|
code span.ch { color: #4070a0; } /* Char */
|
|
code span.cn { color: #880000; } /* Constant */
|
|
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
|
|
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
|
|
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
|
|
code span.dt { color: #902000; } /* DataType */
|
|
code span.dv { color: #40a070; } /* DecVal */
|
|
code span.er { color: #ff0000; font-weight: bold; } /* Error */
|
|
code span.ex { } /* Extension */
|
|
code span.fl { color: #40a070; } /* Float */
|
|
code span.fu { color: #06287e; } /* Function */
|
|
code span.im { } /* Import */
|
|
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
|
|
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
|
|
code span.op { color: #666666; } /* Operator */
|
|
code span.ot { color: #007020; } /* Other */
|
|
code span.pp { color: #bc7a00; } /* Preprocessor */
|
|
code span.sc { color: #4070a0; } /* SpecialChar */
|
|
code span.ss { color: #bb6688; } /* SpecialString */
|
|
code span.st { color: #4070a0; } /* String */
|
|
code span.va { color: #19177c; } /* Variable */
|
|
code span.vs { color: #4070a0; } /* VerbatimString */
|
|
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
|
|
</style>
|
|
<link rel="stylesheet" href="css/zip-style.css"><link rel="stylesheet" href="assets/css/style.css"></head>
|
|
<body>
|
|
<pre><code>ZIP: 243
|
|
Title: Transaction Signature Verification for Sapling
|
|
Owners: Jack Grigg <str4d@electriccoin.co>
|
|
Daira Hopwood <daira@electriccoin.co>
|
|
Credits: Simon Liu <simon@bitcartel.com> (Update 2018-10-15)
|
|
Status: Final
|
|
Category: Consensus
|
|
Created: 2018-04-10
|
|
License: MIT</code></pre>
|
|
<h1 id="terminology">Terminology</h1>
|
|
<p>The key words "MUST" and "MUST NOT" in this document are to be interpreted as described in RFC 2119.<a href="#fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></p>
|
|
<p>The terms "branch" and "network upgrade" in this document are to be interpreted as described in ZIP 200.<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></p>
|
|
<p>The term "Sapling" in this document is to be interpreted as described in ZIP 205.<a href="#fn3" class="footnote-ref" id="fnref3"><sup>3</sup></a></p>
|
|
<h1 id="abstract">Abstract</h1>
|
|
<p>This proposal defines a new transaction digest algorithm for signature verification from the Sapling network upgrade, to account for the presence of Sapling shielded inputs and outputs in transactions.</p>
|
|
<h1 id="motivation">Motivation</h1>
|
|
<p>The Sapling network upgrade introduced new shielded inputs and outputs. We want these to be covered by the transaction digest algorithm used for signatures, in order to ensure they are correctly bound.</p>
|
|
<h1 id="specification">Specification</h1>
|
|
<p>A new transaction digest algorithm is defined:</p>
|
|
<pre><code>BLAKE2b-256 hash of the serialization of:
|
|
1. header of the transaction (4-byte little endian)
|
|
2. nVersionGroupId of the transaction (4-byte little endian)
|
|
3. hashPrevouts (32-byte hash)
|
|
4. hashSequence (32-byte hash)
|
|
5. hashOutputs (32-byte hash)
|
|
6. hashJoinSplits (32-byte hash)
|
|
7. hashShieldedSpends (32-byte hash)
|
|
8. hashShieldedOutputs (32-byte hash)
|
|
9. nLockTime of the transaction (4-byte little endian)
|
|
10. nExpiryHeight of the transaction (4-byte little endian)
|
|
11. valueBalance of the transaction (8-byte little endian)
|
|
12. sighash type of the signature (4-byte little endian)
|
|
|
|
13. If we are serializing a transparent input (i.e. this hash is not for a JoinSplit signature,
|
|
Spend authorization signature, or binding signature):
|
|
a. outpoint (32-byte hash + 4-byte little endian)
|
|
b. scriptCode of the input (serialized as scripts inside CTxOuts)
|
|
c. value of the output spent by this input (8-byte little endian)
|
|
d. nSequence of the input (4-byte little endian)</code></pre>
|
|
<p>The new algorithm is based on the transaction digest algorithm defined in ZIP 143<a href="#fn4" class="footnote-ref" id="fnref4"><sup>4</sup></a>.</p>
|
|
<p>The new algorithm MUST be used for signatures created over the Sapling transaction format<a href="#fn5" class="footnote-ref" id="fnref5"><sup>5</sup></a>. Combined with the new consensus rule that v3 transaction formats will be invalid from the Sapling upgrade, this effectively means that all transaction signatures from the Sapling activation height (as specified in<a href="#fn6" class="footnote-ref" id="fnref6"><sup>6</sup></a>) will use the new algorithm.</p>
|
|
<p>The BLAKE2b-256 personalization field<a href="#fn7" class="footnote-ref" id="fnref7"><sup>7</sup></a> is set to:</p>
|
|
<pre><code>"ZcashSigHash" || CONSENSUS_BRANCH_ID</code></pre>
|
|
<p><code>CONSENSUS_BRANCH_ID</code> is the little-endian encoding of <code>BRANCH_ID</code> for the epoch of the block containing the transaction.<a href="#fn8" class="footnote-ref" id="fnref8"><sup>8</sup></a> Domain separation of the signature hash across parallel branches provides replay protection: transactions targeted for one branch will have invalid signatures on other branches.</p>
|
|
<p>Transaction creators MUST specify the epoch they want their transaction to be mined in. Across a network upgrade, this means that if a transaction is not mined before the activation height, it will never be mined.</p>
|
|
<p>Semantics of the original sighash types are as in ZIP 143<a href="#fn9" class="footnote-ref" id="fnref9"><sup>9</sup></a>.</p>
|
|
<h2 id="field-definitions">Field definitions</h2>
|
|
<p>The items 1, 2, 3, 4, 5, 9, 10, 12, and 13 have the same meaning as in ZIP 143<a href="#fn10" class="footnote-ref" id="fnref10"><sup>10</sup></a>.</p>
|
|
<h3 id="hashjoinsplits">6: <code>hashJoinSplits</code></h3>
|
|
<ul>
|
|
<li>If <code>vjoinsplits</code> is non-empty, <code>hashJoinSplits</code> is the BLAKE2b-256 hash of the serialization of all JoinSplit descriptions (in their canonical v4 transaction serialization format) concatenated with the <code>joinSplitPubKey</code>;
|
|
<ul>
|
|
<li>The BLAKE2b-256 personalization field is set to <code>ZcashJSplitsHash</code>.</li>
|
|
<li>Note that while signatures are omitted, the JoinSplit proofs are included in the signature hash, as with v1, v2, and v3 transactions.</li>
|
|
</ul></li>
|
|
<li>Otherwise, <code>hashJoinSplits</code> is a <code>uint256</code> of <code>0x0000......0000</code>.</li>
|
|
</ul>
|
|
<h3 id="hashshieldedspends">7: <code>hashShieldedSpends</code></h3>
|
|
<ul>
|
|
<li>If <code>vShieldedSpend</code> is non-empty, <code>hashShieldedSpends</code> is the BLAKE2b-256 hash of the serialization of all Spend Descriptions (in their canonical transaction serialization format minus <code>spendAuthSig</code>);
|
|
<ul>
|
|
<li>The BLAKE2b-256 personalization field is set to <code>ZcashSSpendsHash</code>.</li>
|
|
<li>Note that the Spend proofs are included in the signature hash, as with JoinSplit proofs in v1, v2, and v3 transactions.</li>
|
|
</ul></li>
|
|
<li>Otherwise, <code>hashShieldedSpends</code> is a <code>uint256</code> of <code>0x0000......0000</code>.</li>
|
|
</ul>
|
|
<h3 id="hashshieldedoutputs">8: <code>hashShieldedOutputs</code></h3>
|
|
<ul>
|
|
<li>If <code>vShieldedOutput</code> is non-empty, <code>hashShieldedOutputs</code> is the BLAKE2b-256 hash of the serialization of all Output Descriptions (in their canonical transaction serialization format);
|
|
<ul>
|
|
<li>The BLAKE2b-256 personalization field is set to <code>ZcashSOutputHash</code>.</li>
|
|
<li>Note that the Output proofs are included in the signature hash, as with JoinSplit proofs in v1, v2, and v3 transactions.</li>
|
|
</ul></li>
|
|
<li>Otherwise, <code>hashShieldedOutputs</code> is a <code>uint256</code> of <code>0x0000......0000</code>.</li>
|
|
</ul>
|
|
<h3 id="valuebalance">11: <code>valueBalance</code></h3>
|
|
<p>An 8-byte signed two's-complement little-endian value of the net amount, in zatoshi, exiting the Sapling value pool. For clarity, a negative value corresponds to an amount <em>entering</em> the Sapling value pool.</p>
|
|
<h2 id="notes">Notes</h2>
|
|
<p>The <code>hashPrevouts</code>, <code>hashSequence</code>, <code>hashOutputs</code>, <code>hashJoinSplits</code>, <code>hashShieldedSpends</code>, and <code>hashShieldedOutputs</code> calculated in an earlier verification can be reused in other inputs of the same transaction, so that the time complexity of the whole hashing process reduces from O(n<sup>2</sup>) to O(n).</p>
|
|
<p>Refer to the reference implementation, reproduced below, for the precise algorithm:</p>
|
|
<div class="sourceCode" id="cb4"><pre class="sourceCode cpp"><code class="sourceCode cpp"><a class="sourceLine" id="cb4-1" title="1"><span class="at">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> ZCASH_PREVOUTS_HASH_PERSONALIZATION[<span class="dv">16</span>] =</a>
|
|
<a class="sourceLine" id="cb4-2" title="2"> {<span class="ch">'Z'</span>,<span class="ch">'c'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>,<span class="ch">'P'</span>,<span class="ch">'r'</span>,<span class="ch">'e'</span>,<span class="ch">'v'</span>,<span class="ch">'o'</span>,<span class="ch">'u'</span>,<span class="ch">'t'</span>,<span class="ch">'H'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>};</a>
|
|
<a class="sourceLine" id="cb4-3" title="3"><span class="at">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> ZCASH_SEQUENCE_HASH_PERSONALIZATION[<span class="dv">16</span>] =</a>
|
|
<a class="sourceLine" id="cb4-4" title="4"> {<span class="ch">'Z'</span>,<span class="ch">'c'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>,<span class="ch">'S'</span>,<span class="ch">'e'</span>,<span class="ch">'q'</span>,<span class="ch">'u'</span>,<span class="ch">'e'</span>,<span class="ch">'n'</span>,<span class="ch">'c'</span>,<span class="ch">'H'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>};</a>
|
|
<a class="sourceLine" id="cb4-5" title="5"><span class="at">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> ZCASH_OUTPUTS_HASH_PERSONALIZATION[<span class="dv">16</span>] =</a>
|
|
<a class="sourceLine" id="cb4-6" title="6"> {<span class="ch">'Z'</span>,<span class="ch">'c'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>,<span class="ch">'O'</span>,<span class="ch">'u'</span>,<span class="ch">'t'</span>,<span class="ch">'p'</span>,<span class="ch">'u'</span>,<span class="ch">'t'</span>,<span class="ch">'s'</span>,<span class="ch">'H'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>};</a>
|
|
<a class="sourceLine" id="cb4-7" title="7"><span class="at">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> ZCASH_JOINSPLITS_HASH_PERSONALIZATION[<span class="dv">16</span>] =</a>
|
|
<a class="sourceLine" id="cb4-8" title="8"> {<span class="ch">'Z'</span>,<span class="ch">'c'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>,<span class="ch">'J'</span>,<span class="ch">'S'</span>,<span class="ch">'p'</span>,<span class="ch">'l'</span>,<span class="ch">'i'</span>,<span class="ch">'t'</span>,<span class="ch">'s'</span>,<span class="ch">'H'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>};</a>
|
|
<a class="sourceLine" id="cb4-9" title="9"><span class="at">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> ZCASH_SHIELDED_SPENDS_HASH_PERSONALIZATION[<span class="dv">16</span>] =</a>
|
|
<a class="sourceLine" id="cb4-10" title="10"> {<span class="ch">'Z'</span>,<span class="ch">'c'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>,<span class="ch">'S'</span>,<span class="ch">'S'</span>,<span class="ch">'p'</span>,<span class="ch">'e'</span>,<span class="ch">'n'</span>,<span class="ch">'d'</span>,<span class="ch">'s'</span>,<span class="ch">'H'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>};</a>
|
|
<a class="sourceLine" id="cb4-11" title="11"><span class="at">const</span> <span class="dt">unsigned</span> <span class="dt">char</span> ZCASH_SHIELDED_OUTPUTS_HASH_PERSONALIZATION[<span class="dv">16</span>] =</a>
|
|
<a class="sourceLine" id="cb4-12" title="12"> {<span class="ch">'Z'</span>,<span class="ch">'c'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>,<span class="ch">'S'</span>,<span class="ch">'O'</span>,<span class="ch">'u'</span>,<span class="ch">'t'</span>,<span class="ch">'p'</span>,<span class="ch">'u'</span>,<span class="ch">'t'</span>,<span class="ch">'H'</span>,<span class="ch">'a'</span>,<span class="ch">'s'</span>,<span class="ch">'h'</span>};</a>
|
|
<a class="sourceLine" id="cb4-13" title="13"></a>
|
|
<a class="sourceLine" id="cb4-14" title="14"><span class="co">// The default values are zeroes</span></a>
|
|
<a class="sourceLine" id="cb4-15" title="15">uint256 hashPrevouts;</a>
|
|
<a class="sourceLine" id="cb4-16" title="16">uint256 hashSequence;</a>
|
|
<a class="sourceLine" id="cb4-17" title="17">uint256 hashOutputs;</a>
|
|
<a class="sourceLine" id="cb4-18" title="18">uint256 hashJoinSplits;</a>
|
|
<a class="sourceLine" id="cb4-19" title="19">uint256 hashShieldedSpends;</a>
|
|
<a class="sourceLine" id="cb4-20" title="20">uint256 hashShieldedOutputs;</a>
|
|
<a class="sourceLine" id="cb4-21" title="21"></a>
|
|
<a class="sourceLine" id="cb4-22" title="22"><span class="cf">if</span> (!(nHashType & SIGHASH_ANYONECANPAY)) {</a>
|
|
<a class="sourceLine" id="cb4-23" title="23"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_PREVOUTS_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-24" title="24"> <span class="cf">for</span> (<span class="dt">unsigned</span> <span class="dt">int</span> n = <span class="dv">0</span>; n < txTo.vin.size(); n++) {</a>
|
|
<a class="sourceLine" id="cb4-25" title="25"> ss << txTo.vin[n].prevout;</a>
|
|
<a class="sourceLine" id="cb4-26" title="26"> }</a>
|
|
<a class="sourceLine" id="cb4-27" title="27"> hashPrevouts = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-28" title="28">}</a>
|
|
<a class="sourceLine" id="cb4-29" title="29"></a>
|
|
<a class="sourceLine" id="cb4-30" title="30"><span class="cf">if</span> (!(nHashType & SIGHASH_ANYONECANPAY) && (nHashType & <span class="bn">0x1f</span>) != SIGHASH_SINGLE && (nHashType & <span class="bn">0x1f</span>) != SIGHASH_NONE) {</a>
|
|
<a class="sourceLine" id="cb4-31" title="31"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_SEQUENCE_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-32" title="32"> <span class="cf">for</span> (<span class="dt">unsigned</span> <span class="dt">int</span> n = <span class="dv">0</span>; n < txTo.vin.size(); n++) {</a>
|
|
<a class="sourceLine" id="cb4-33" title="33"> ss << txTo.vin[n].nSequence;</a>
|
|
<a class="sourceLine" id="cb4-34" title="34"> }</a>
|
|
<a class="sourceLine" id="cb4-35" title="35"> hashSequence = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-36" title="36">}</a>
|
|
<a class="sourceLine" id="cb4-37" title="37"></a>
|
|
<a class="sourceLine" id="cb4-38" title="38"><span class="cf">if</span> ((nHashType & <span class="bn">0x1f</span>) != SIGHASH_SINGLE && (nHashType & <span class="bn">0x1f</span>) != SIGHASH_NONE) {</a>
|
|
<a class="sourceLine" id="cb4-39" title="39"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_OUTPUTS_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-40" title="40"> <span class="cf">for</span> (<span class="dt">unsigned</span> <span class="dt">int</span> n = <span class="dv">0</span>; n < txTo.vout.size(); n++) {</a>
|
|
<a class="sourceLine" id="cb4-41" title="41"> ss << txTo.vout[n];</a>
|
|
<a class="sourceLine" id="cb4-42" title="42"> }</a>
|
|
<a class="sourceLine" id="cb4-43" title="43"> hashOutputs = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-44" title="44">} <span class="cf">else</span> <span class="cf">if</span> ((nHashType & <span class="bn">0x1f</span>) == SIGHASH_SINGLE && nIn < txTo.vout.size()) {</a>
|
|
<a class="sourceLine" id="cb4-45" title="45"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_OUTPUTS_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-46" title="46"> ss << txTo.vout[nIn];</a>
|
|
<a class="sourceLine" id="cb4-47" title="47"> hashOutputs = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-48" title="48">}</a>
|
|
<a class="sourceLine" id="cb4-49" title="49"></a>
|
|
<a class="sourceLine" id="cb4-50" title="50"><span class="cf">if</span> (!txTo.vjoinsplit.empty()) {</a>
|
|
<a class="sourceLine" id="cb4-51" title="51"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_JOINSPLITS_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-52" title="52"> <span class="cf">for</span> (<span class="dt">unsigned</span> <span class="dt">int</span> n = <span class="dv">0</span>; n < txTo.vjoinsplit.size(); n++) {</a>
|
|
<a class="sourceLine" id="cb4-53" title="53"> ss << txTo.vjoinsplit[n];</a>
|
|
<a class="sourceLine" id="cb4-54" title="54"> }</a>
|
|
<a class="sourceLine" id="cb4-55" title="55"> ss << txTo.joinSplitPubKey;</a>
|
|
<a class="sourceLine" id="cb4-56" title="56"> hashJoinSplits = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-57" title="57">}</a>
|
|
<a class="sourceLine" id="cb4-58" title="58"></a>
|
|
<a class="sourceLine" id="cb4-59" title="59"><span class="cf">if</span> (!txTo.vShieldedSpend.empty()) {</a>
|
|
<a class="sourceLine" id="cb4-60" title="60"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_SHIELDED_SPENDS_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-61" title="61"> <span class="cf">for</span> (<span class="dt">unsigned</span> <span class="dt">int</span> n = <span class="dv">0</span>; n < txTo.vShieldedSpend.size(); n++) {</a>
|
|
<a class="sourceLine" id="cb4-62" title="62"> ss << txTo.vShieldedSpend[n].cv;</a>
|
|
<a class="sourceLine" id="cb4-63" title="63"> ss << txTo.vShieldedSpend[n].anchor;</a>
|
|
<a class="sourceLine" id="cb4-64" title="64"> ss << txTo.vShieldedSpend[n].nullifier;</a>
|
|
<a class="sourceLine" id="cb4-65" title="65"> ss << txTo.vShieldedSpend[n].rk;</a>
|
|
<a class="sourceLine" id="cb4-66" title="66"> ss << txTo.vShieldedSpend[n].zkproof;</a>
|
|
<a class="sourceLine" id="cb4-67" title="67"> }</a>
|
|
<a class="sourceLine" id="cb4-68" title="68"> hashShieldedSpends = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-69" title="69">}</a>
|
|
<a class="sourceLine" id="cb4-70" title="70"></a>
|
|
<a class="sourceLine" id="cb4-71" title="71"><span class="cf">if</span> (!txTo.vShieldedOutput.empty()) {</a>
|
|
<a class="sourceLine" id="cb4-72" title="72"> CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, ZCASH_SHIELDED_OUTPUTS_HASH_PERSONALIZATION);</a>
|
|
<a class="sourceLine" id="cb4-73" title="73"> <span class="cf">for</span> (<span class="dt">unsigned</span> <span class="dt">int</span> n = <span class="dv">0</span>; n < txTo.vShieldedOutput.size(); n++) {</a>
|
|
<a class="sourceLine" id="cb4-74" title="74"> ss << txTo.vShieldedOutput[n];</a>
|
|
<a class="sourceLine" id="cb4-75" title="75"> }</a>
|
|
<a class="sourceLine" id="cb4-76" title="76"> hashShieldedOutputs = ss.GetHash();</a>
|
|
<a class="sourceLine" id="cb4-77" title="77">}</a>
|
|
<a class="sourceLine" id="cb4-78" title="78"></a>
|
|
<a class="sourceLine" id="cb4-79" title="79"><span class="dt">uint32_t</span> leConsensusBranchId = htole32(consensusBranchId);</a>
|
|
<a class="sourceLine" id="cb4-80" title="80"><span class="dt">unsigned</span> <span class="dt">char</span> personalization[<span class="dv">16</span>] = {};</a>
|
|
<a class="sourceLine" id="cb4-81" title="81">memcpy(personalization, <span class="st">"ZcashSigHash"</span>, <span class="dv">12</span>);</a>
|
|
<a class="sourceLine" id="cb4-82" title="82">memcpy(personalization+<span class="dv">12</span>, &leConsensusBranchId, <span class="dv">4</span>);</a>
|
|
<a class="sourceLine" id="cb4-83" title="83"></a>
|
|
<a class="sourceLine" id="cb4-84" title="84">CBLAKE2bWriter ss(SER_GETHASH, <span class="dv">0</span>, personalization);</a>
|
|
<a class="sourceLine" id="cb4-85" title="85"><span class="co">// fOverwintered and nVersion</span></a>
|
|
<a class="sourceLine" id="cb4-86" title="86">ss << txTo.GetHeader();</a>
|
|
<a class="sourceLine" id="cb4-87" title="87"><span class="co">// Version group ID</span></a>
|
|
<a class="sourceLine" id="cb4-88" title="88">ss << txTo.nVersionGroupId;</a>
|
|
<a class="sourceLine" id="cb4-89" title="89"><span class="co">// Input prevouts/nSequence (none/all, depending on flags)</span></a>
|
|
<a class="sourceLine" id="cb4-90" title="90">ss << hashPrevouts;</a>
|
|
<a class="sourceLine" id="cb4-91" title="91">ss << hashSequence;</a>
|
|
<a class="sourceLine" id="cb4-92" title="92"><span class="co">// Outputs (none/one/all, depending on flags)</span></a>
|
|
<a class="sourceLine" id="cb4-93" title="93">ss << hashOutputs;</a>
|
|
<a class="sourceLine" id="cb4-94" title="94"><span class="co">// JoinSplit descriptions</span></a>
|
|
<a class="sourceLine" id="cb4-95" title="95">ss << hashJoinSplits;</a>
|
|
<a class="sourceLine" id="cb4-96" title="96"><span class="co">// Spend descriptions</span></a>
|
|
<a class="sourceLine" id="cb4-97" title="97">ss << hashShieldedSpends;</a>
|
|
<a class="sourceLine" id="cb4-98" title="98"><span class="co">// Output descriptions</span></a>
|
|
<a class="sourceLine" id="cb4-99" title="99">ss << hashShieldedOutputs;</a>
|
|
<a class="sourceLine" id="cb4-100" title="100"><span class="co">// Locktime</span></a>
|
|
<a class="sourceLine" id="cb4-101" title="101">ss << txTo.nLockTime;</a>
|
|
<a class="sourceLine" id="cb4-102" title="102"><span class="co">// Expiry height</span></a>
|
|
<a class="sourceLine" id="cb4-103" title="103">ss << txTo.nExpiryHeight;</a>
|
|
<a class="sourceLine" id="cb4-104" title="104"><span class="co">// Sapling value balance</span></a>
|
|
<a class="sourceLine" id="cb4-105" title="105">ss << txTo.valueBalance;</a>
|
|
<a class="sourceLine" id="cb4-106" title="106"><span class="co">// Sighash type</span></a>
|
|
<a class="sourceLine" id="cb4-107" title="107">ss << nHashType;</a>
|
|
<a class="sourceLine" id="cb4-108" title="108"></a>
|
|
<a class="sourceLine" id="cb4-109" title="109"><span class="cf">if</span> (nIn != NOT_AN_INPUT) {</a>
|
|
<a class="sourceLine" id="cb4-110" title="110"> <span class="co">// The input being signed (replacing the scriptSig with scriptCode + amount)</span></a>
|
|
<a class="sourceLine" id="cb4-111" title="111"> <span class="co">// The prevout may already be contained in hashPrevout, and the nSequence</span></a>
|
|
<a class="sourceLine" id="cb4-112" title="112"> <span class="co">// may already be contained in hashSequence.</span></a>
|
|
<a class="sourceLine" id="cb4-113" title="113"> ss << txTo.vin[nIn].prevout;</a>
|
|
<a class="sourceLine" id="cb4-114" title="114"> ss << <span class="kw">static_cast</span><<span class="at">const</span> CScriptBase&>(scriptCode);</a>
|
|
<a class="sourceLine" id="cb4-115" title="115"> ss << amount;</a>
|
|
<a class="sourceLine" id="cb4-116" title="116"> ss << txTo.vin[nIn].nSequence;</a>
|
|
<a class="sourceLine" id="cb4-117" title="117">}</a>
|
|
<a class="sourceLine" id="cb4-118" title="118"></a>
|
|
<a class="sourceLine" id="cb4-119" title="119"><span class="cf">return</span> ss.GetHash();</a></code></pre></div>
|
|
<h1 id="example">Example</h1>
|
|
<p>To ensure consistency in consensus-critical behaviour, developers should test their implementations against the ZIP 243 test vectors<a href="#fn11" class="footnote-ref" id="fnref11"><sup>11</sup></a>. The first two test vectors are broken out below for clarity. Note that 32-byte values below are exactly as the hash function returns, and are not reversed. Further examples can be found in the SignatureHash test data<a href="#fn12" class="footnote-ref" id="fnref12"><sup>12</sup></a>.</p>
|
|
<p>The sample transactions below and in<a href="#fn13" class="footnote-ref" id="fnref13"><sup>13</sup></a> are intended only for testing implementations of the transaction digest algorithm; they do not necessarily pass full validation.</p>
|
|
<h2 id="test-vector-1">Test vector 1</h2>
|
|
<p>Raw transaction:</p>
|
|
<pre><code>0400008085202f890002e7719811893e0000095200ac6551ac636565b2835a0805750200025151481cdd86b3cc4318442117623ceb0500031b3d1a027c2c40590958b7eb13d742a997738c46a458965baf276ba92f272c721fe01f7e9c8e36d6a5e29d4e30a73594bf5098421c69378af1e40f64e125946f62c2fa7b2fecbcb64b6968912a6381ce3dc166d56a1d62f5a8d7551db5fd931325c9a138f49b1a537edcf04be34a9851a7af9db6990ed83dd64af3597c04323ea51b0052ad8084a8b9da948d320dadd64f5431e61ddf658d24ae67c22c8d1309131fc00fe7f235734276d38d47f1e191e00c7a1d48af046827591e9733a97fa6b679f3dc601d008285edcbdae69ce8fc1be4aac00ff2711ebd931de518856878f73476f21a482ec9378365c8f7393c94e2885315eb4671098b79535e790fe53e29fef2b3766697ac32b4f473f468a008e72389fc03880d780cb07fcfaabe3f1a84b27db59a4a153d882d2b2103596555ed9494c6ac893c49723833ec8926c1039586a7afcf4a0d9c731e985d99589c8bb838e8aaf745533ed9e8ae3a1cd074a51a20da8aba18d1dbebbc862ded42435e92476930d069896cff30eb414f727b895a4b7be1769367e1fe8ad18de11e58d88a0ad5511d3525122b7b0a6f25d28b16457e745939ffedbd12863ce71a02af117d417adb3d15cc54dcb1fce467500c6b8fb86b12b56da9c382857deecc40a98d5f2935395ee4762dd21afdbb5d47fa9a6dd984d567db2857b927b7fae2db587105415d4642789d38f50b8dbcc129cab3d17d19f3355bcf73cecb8cb8a5da01307152f13936a270572670dc82d39026c6cb4cd4b0f7f5aa2a4f5a5341ec5dd715406f2fdd2afa733f5f641c8c21862a1bafce2609d9eecfa158cfb5cd79f88008e315dc7d8388e76c1782fd2795d18a763624c25fa959cc97489ce75745824b77868c53239cfbdf73caec65604037314faaceb56218c6bd30f8374ac13386793f21a9fb80ad03bc0cda4a44946c00e1b1a1df0e5b87b5bece477a709649e950060591394812951e1fe3895b8cc3d14d2cf6556df6ed4b4ddd3d9a69f53357d7767f4f5ccbdbc596631277f8fecd08cb056b95e3025b9792fff7f244fc716269b926d62e9596fa825c6bf21aff9e68625a6b4cbc4b700a364fa76bd8298bc3ec608d4cf7f3566658d5588714ec9448b0f0396128aef884a646114c9f1a6df56319033c3199cc7a09e9e9567482c92695390229407bbc48985675e3f874a4533f1d63a84dfa3e0f460fe2f57e34fbc75423b6883a50a0d470190dfba10a857f82842d3825b3d6da0573d316eb160dc0b716c48fbd467f75b780149ae8808f4e68f50c0536acddf6f1aeab016b6bc1ec144b4e553acfd670f77e755fc88e0677e31ba459b44e307768958fe3789d41c2b1ff434cb30e15914f01bc6bc2307b488d2556d7b7380ea4ffd712f6b02fe806b94569cd4059f396bf29b99d0a40e5e1711ca944f72d436a102fca4b97693da0b086fe9d2e7162470d02e0f05d4bec9512bfb3f38327296efaa74328b118c27402c70c3a90b49ad4bbc68e37c0aa7d9b3fe17799d73b841e751713a02943905aae0803fd69442eb7681ec2a05600054e92eed555028f21b6a155268a2dd6640a69301a52a38d4d9f9f957ae35af7167118141ce4c9be0a6a492fe79f1581a155fa3a034999c538f7a758bb5b1d28fd218fba1938744bdb77b4a4dfa7a5fae96e8cd49b26907dfc6685c5c99b7141ac626ab4761fd3f41e728e1a28f89db89ffdeca364e4b22d81d9968d0119e4c7a189adf22ad96830a54e40dc73eaba6b2aaf14f7ca942e7370b247c046f8e75ef8e3f8bd821cf577491864e20e6d08fd2e32b555c92c661f19588b72a89599710a88061253ca285b6304b37da2b5294f5cb354a894322848ccbdc7c2545b7da568afac87ffa005c312241c2d57f4b45d6419f0d2e2c5af33ae243785b325cdab95404fc7aed70525cddb41872cfcc214b13232edc78609753dbff930eb0dc156612b9cb434bc4b693392deb87c530435312edcedc6a961133338d786c4a3e103f60110a16b1337129704bf4754ff6ba9fbe65951e610620f71cda8fc877625f2c5bb04cbe1228b1e886f4050afd8fe94e97d2e9e85c6bb748c0042d3249abb1342bb0eebf62058bf3de080d94611a3750915b5dc6c0b3899d41222bace760ee9c8818ded599e34c56d7372af1eb86852f2a732104bdb750739de6c2c6e0f9eb7cb17f1942bfc9f4fd6ebb6b4cdd4da2bca26fac4578e9f543405acc7d86ff59158bd0cba3aef6f4a8472d144d99f8b8d1dedaa9077d4f01d4bb27bbe31d88fbefac3dcd4797563a26b1d61fcd9a464ab21ed550fe6fa09695ba0b2f10eea6468cc6e20a66f826e3d14c5006f0563887f5e1289be1b2004caca8d3f34d6e84bf59c1e04619a7c23a996941d889e4622a9b9b1d59d5e319094318cd405ba27b7e2c084762d31453ec4549a4d97729d033460fcf89d6494f2ffd789e98082ea5ce9534b3acd60fe49e37e4f666931677319ed89f85588741b3128901a93bd78e4be0225a9e2692c77c969ed0176bdf9555948cbd5a332d045de6ba6bf4490adfe7444cd467a09075417fcc0062e49f008c51ad4227439c1b4476ccd8e97862dab7be1e8d399c05ef27c6e22ee273e15786e394c8f1be31682a30147963ac8da8d41d804258426a3f70289b8ad19d8de13be4eebe3bd4c8a6f55d6e0c373d456851879f5fbc282db9e134806bff71e11bc33ab75dd6ca067fb73a043b646a7cf39cab4928386786d2f24141ee120fdc34d6764eafc66880ee0204f53cc1167ed20b43a52dea3ca7cff8ef35cd8e6d7c111a68ef44bcd0c1513ad47ca61c659cc5d325b440f6b9f59aff66879bb6688fd2859362b182f207b3175961f6411a493bffd048e7d0d87d82fe6f990a2b0a25f5aa0111a6e68f37bf6f3ac2d26b84686e569d58d99c1383597fad81193c4c1b16e6a90e2d507cdfe6fbdaa86163e9cf5de3100fbca7e8da047b09079362d7792deb3ca9dc1561b87c82e3cb99eb5837319582216a3226774efa90efb7bfc79f425644e4e98c2d7d8642b9db82aa739bf2d71cc4117227db227cf0a05ad9a95832e23c94f271ca0e4694fac6322282ebac6986b8fdc8ad863084ff10fd11e6a13311fb799c79c641d9da43b33e7ad012e28255398789262275f1175be8462c01491c4d842406d0ec4282c9526174a09878fe8fdde33a29604e5e5e7b2a025d6650b97dbb52befb59b1d30a57433b0a351474444099daa371046613260cf3354cfcdada663ece824ffd7e44393886a86165ddddf2b4c41773554c86995269408b11e6737a4c447586f69173446d8e48bf84cbc000a807899973eb93c5e819aad669413f8387933ad1584aa35e43f4ecd1e2d0407c0b1b89920ffdfdb9bea51ac95b557af71b89f903f5d9848f14fcbeb1837570f544d6359eb23faf38a0822da36ce426c4a2fbeffeb0a8a2e297a9d19ba15024590e3329d9fa9261f9938a4032dd34606c9cf9f3dd33e576f05cd1dd6811c6298757d77d9e810abdb226afcaa4346a6560f8932b3181fd355d5d391976183f8d99388839632d6354f666d09d3e5629ea19737388613d38a34fd0f6e50ee5a0cc9677177f50028c141378187bd2819403fc534f80076e9380cb4964d3b6b45819d3b8e9caf54f051852d671bf8c1ffde2d1510756418cb4810936aa57e6965d6fb656a760b7f19adf96c173488552193b147ee58858033dac7cd0eb204c06490bbdedf5f7571acb2ebe76acef3f2a01ee987486dfe6c3f0a5e234c127258f97a28fb5d164a8176be946b8097d0e317287f33bf9c16f9a545409ce29b1f4273725fc0df02a04ebae178b3414fb0a82d50deb09fcf4e6ee9d180ff4f56ff3bc1d3601fc2dc90d814c3256f4967d3a8d64c83fea339c51f5a8e5801fbb97835581b602465dee04b5922c2761b54245bec0c9eef2db97d22b2b3556cc969fbb13d06509765a52b3fac54b93f421bf08e18d52ddd52cc1c8ca8adfaccab7e5cc2f4573fbbf8239bb0b8aedbf8dad16282da5c9125dba1c059d0df8abf621078f02d6c4bc86d40845ac1d59710c45f07d585eb48b32fc0167ba256e73ca3b9311c62d109497957d8dbe10aa3e866b40c0baa2bc492c19ad1e6372d9622bf163fbffeaeee796a3cd9b6fbbfa4d792f34d7fd6e763cd5859dd26833d21d9bc5452bd19515dff9f4995b35bc0c1f876e6ad11f2452dc9ae85aec01fc56f8cbfda75a7727b75ebbd6bbffb43b63a3b1b671e40feb0db002974a3c3b1a788567231bf6399ff89236981149d423802d2341a3bedb9ddcbac1fe7b6435e1479c72e7089b51bfe2ff345857da9b545e88e3221f3f5f72d1e069c9a85dd2236d390989587be005cda16af4408f3ab06a916eeeb9c9594b70424a4c1d171295b6763b22f4712ba7beff0ff27883afaff26034b895735709cf937bd2231891e70eb2771e9927c97f8764eb48e911d428ec8d861b708e8298acb62155145155ae95f0a1d1501034753146e22d05f586d7f6b4fe12dad9a17f5db70b1db96b8d9a83edadc966c8a5466b61fc998c31f1070d9a5c9a6d268d304fe6b8fd3b4010348611abdcbd49fe4f85b623c7828c71382e1034ea67bc8ae97404b0c50b2a04f559e49950afcb0ef462a2ae024b0f0224dfd73684b88c7fbe92d02b68f759c4752663cd7b97a14943649305521326bde085630864629291bae25ff8822a14c4b666a9259ad0dc42a8290ac7bc7f53a16f379f758e5de750f04fd7cad47701c8597f97888bea6fa0bf2999956fbfd0ee68ec36e4688809ae231eb8bc4369f5fe1573f57e099d9c09901bf39caac48dc11956a8ae905ead86954547c448ae43d315e669c4242da565938f417bf43ce7b2b30b1cd4018388e1a910f0fc41fb0877a5925e466819d375b0a912d4fe843b76ef6f223f0f7c894f38f7ab780dfd75f669c8c06cffa43eb47565a50e3b1fa45ad61ce9a1c4727b7aaa53562f523e73952bbf33d8a4104078ade3eaaa49699a69fdf1c5ac7732146ee5e1d6b6ca9b9180f964cc9d0878ae1373524d7d510e58227df6de9d30d271867640177b0f1856e28d5c8afb095ef6184fed651589022eeaea4c0ce1fa6f085092b04979489172b3ef8194a798df5724d6b05f1ae000013a08d612bca8a8c31443c10346dbf61de8475c0bbec5104b47556af3d514458e2321d146071789d2335934a680614e83562f82dfd405b54a45eb32c165448d4d5d61ca2859585369f53f1a137e9e82b67b8fdaf01bda54a317311896ae10280a032440c420a421e944d1e952b70d5826cd3b08b7db9630fe4fd5f22125de840fcc40b98038af11d55be25432597b4b65b9ec1c7a8bbfd052cbf7e1c1785314934b262d5853754f1f17771cfb7503072655753fa3f54ecc587e9f83b581916092df26e63e18994cb0db91a0bbdc7b6119b32222adf5e61d8d8ae89dae4954b54813bb33f08d562ba513fee1b09c0fcd516055419474dd7fda038a89c84ea7b9468287f0eb0c10c4b132520194d3d8d5351fc10d09c15c8cc101aa1663bbf17b84111f38bb439f07353bdea3596d15e713e1e2e7d3f1c383135b47fa7f81f46df7a902a404699ec912f5656c35b85763e4de583aecaa1dfd5d2677d9c8ffee877f63f40a5ca0d67f6e554124700f805af876aeede53aa8b0f8e5604a73c30cbd09dad963d6f8a5dcc40def40797342113ba206fae8ebe4f3bc3caf69259e462eff9ba8b3f4bfaa1300c26925a87
|
|
|
|
header: 04000080
|
|
nVersionGroupId: 85202f89
|
|
vin: 00
|
|
vout: 02 e7719811893e0000 095200ac6551ac636565
|
|
b2835a0805750200 025151
|
|
nLockTime: 481cdd86
|
|
nExpiryHeight: b3cc4318
|
|
valueBalance: 442117623ceb0500
|
|
vShieldedSpend: 03
|
|
cv: 1b3d1a027c2c40590958b7eb13d742a997738c46a458965baf276ba92f272c72
|
|
anchor: 1fe01f7e9c8e36d6a5e29d4e30a73594bf5098421c69378af1e40f64e125946f
|
|
nullifier: 62c2fa7b2fecbcb64b6968912a6381ce3dc166d56a1d62f5a8d7551db5fd9313
|
|
rk: 25c9a138f49b1a537edcf04be34a9851a7af9db6990ed83dd64af3597c04323e
|
|
zkproof: a51b0052ad8084a8b9da948d320dadd64f5431e61ddf658d24ae67c22c8d1309131fc00fe7f235734276d38d47f1e191e00c7a1d48af046827591e9733a97fa6b679f3dc601d008285edcbdae69ce8fc1be4aac00ff2711ebd931de518856878f73476f21a482ec9378365c8f7393c94e2885315eb4671098b79535e790fe53e29fef2b3766697ac32b4f473f468a008e72389fc03880d780cb07fcfaabe3f1a84b27db59a4a153d882d2b2103596555ed9494c6ac893c49723833ec8926c103
|
|
spendAuthSig: 9586a7afcf4a0d9c731e985d99589c8bb838e8aaf745533ed9e8ae3a1cd074a51a20da8aba18d1dbebbc862ded42435e92476930d069896cff30eb414f727b89
|
|
|
|
cv: 5a4b7be1769367e1fe8ad18de11e58d88a0ad5511d3525122b7b0a6f25d28b16
|
|
anchor: 457e745939ffedbd12863ce71a02af117d417adb3d15cc54dcb1fce467500c6b
|
|
nullifier: 8fb86b12b56da9c382857deecc40a98d5f2935395ee4762dd21afdbb5d47fa9a
|
|
rk: 6dd984d567db2857b927b7fae2db587105415d4642789d38f50b8dbcc129cab3
|
|
zkproof: d17d19f3355bcf73cecb8cb8a5da01307152f13936a270572670dc82d39026c6cb4cd4b0f7f5aa2a4f5a5341ec5dd715406f2fdd2afa733f5f641c8c21862a1bafce2609d9eecfa158cfb5cd79f88008e315dc7d8388e76c1782fd2795d18a763624c25fa959cc97489ce75745824b77868c53239cfbdf73caec65604037314faaceb56218c6bd30f8374ac13386793f21a9fb80ad03bc0cda4a44946c00e1b1a1df0e5b87b5bece477a709649e950060591394812951e1fe3895b8cc3d14d2c
|
|
spendAuthSig: f6556df6ed4b4ddd3d9a69f53357d7767f4f5ccbdbc596631277f8fecd08cb056b95e3025b9792fff7f244fc716269b926d62e9596fa825c6bf21aff9e68625a
|
|
|
|
cv: 6b4cbc4b700a364fa76bd8298bc3ec608d4cf7f3566658d5588714ec9448b0f0
|
|
anchor: 396128aef884a646114c9f1a6df56319033c3199cc7a09e9e9567482c9269539
|
|
nullifier: 0229407bbc48985675e3f874a4533f1d63a84dfa3e0f460fe2f57e34fbc75423
|
|
rk: b6883a50a0d470190dfba10a857f82842d3825b3d6da0573d316eb160dc0b716
|
|
zkproof: c48fbd467f75b780149ae8808f4e68f50c0536acddf6f1aeab016b6bc1ec144b4e553acfd670f77e755fc88e0677e31ba459b44e307768958fe3789d41c2b1ff434cb30e15914f01bc6bc2307b488d2556d7b7380ea4ffd712f6b02fe806b94569cd4059f396bf29b99d0a40e5e1711ca944f72d436a102fca4b97693da0b086fe9d2e7162470d02e0f05d4bec9512bfb3f38327296efaa74328b118c27402c70c3a90b49ad4bbc68e37c0aa7d9b3fe17799d73b841e751713a02943905aae08
|
|
spendAuthSig: 03fd69442eb7681ec2a05600054e92eed555028f21b6a155268a2dd6640a69301a52a38d4d9f9f957ae35af7167118141ce4c9be0a6a492fe79f1581a155fa3a
|
|
|
|
vShieldedOutput: 03
|
|
cv: 4999c538f7a758bb5b1d28fd218fba1938744bdb77b4a4dfa7a5fae96e8cd49b
|
|
cmu: 26907dfc6685c5c99b7141ac626ab4761fd3f41e728e1a28f89db89ffdeca364
|
|
ephemeralKey: e4b22d81d9968d0119e4c7a189adf22ad96830a54e40dc73eaba6b2aaf14f7ca
|
|
encCiphertext: 942e7370b247c046f8e75ef8e3f8bd821cf577491864e20e6d08fd2e32b555c92c661f19588b72a89599710a88061253ca285b6304b37da2b5294f5cb354a894322848ccbdc7c2545b7da568afac87ffa005c312241c2d57f4b45d6419f0d2e2c5af33ae243785b325cdab95404fc7aed70525cddb41872cfcc214b13232edc78609753dbff930eb0dc156612b9cb434bc4b693392deb87c530435312edcedc6a961133338d786c4a3e103f60110a16b1337129704bf4754ff6ba9fbe65951e610620f71cda8fc877625f2c5bb04cbe1228b1e886f4050afd8fe94e97d2e9e85c6bb748c0042d3249abb1342bb0eebf62058bf3de080d94611a3750915b5dc6c0b3899d41222bace760ee9c8818ded599e34c56d7372af1eb86852f2a732104bdb750739de6c2c6e0f9eb7cb17f1942bfc9f4fd6ebb6b4cdd4da2bca26fac4578e9f543405acc7d86ff59158bd0cba3aef6f4a8472d144d99f8b8d1dedaa9077d4f01d4bb27bbe31d88fbefac3dcd4797563a26b1d61fcd9a464ab21ed550fe6fa09695ba0b2f10eea6468cc6e20a66f826e3d14c5006f0563887f5e1289be1b2004caca8d3f34d6e84bf59c1e04619a7c23a996941d889e4622a9b9b1d59d5e319094318cd405ba27b7e2c084762d31453ec4549a4d97729d033460fcf89d6494f2ffd789e98082ea5ce9534b3acd60fe49e37e4f666931677319ed89f85588741b3128901a93bd78e4be0225a9e2692c77c969ed0176bdf9555948cbd5a332d045de6ba6bf4490adfe7444cd467a09075417fcc0062e49f008c51ad4227439c1b4476c
|
|
outCiphertext: cd8e97862dab7be1e8d399c05ef27c6e22ee273e15786e394c8f1be31682a30147963ac8da8d41d804258426a3f70289b8ad19d8de13be4eebe3bd4c8a6f55d6e0c373d456851879f5fbc282db9e1348
|
|
zkproof: 06bff71e11bc33ab75dd6ca067fb73a043b646a7cf39cab4928386786d2f24141ee120fdc34d6764eafc66880ee0204f53cc1167ed20b43a52dea3ca7cff8ef35cd8e6d7c111a68ef44bcd0c1513ad47ca61c659cc5d325b440f6b9f59aff66879bb6688fd2859362b182f207b3175961f6411a493bffd048e7d0d87d82fe6f990a2b0a25f5aa0111a6e68f37bf6f3ac2d26b84686e569d58d99c1383597fad81193c4c1b16e6a90e2d507cdfe6fbdaa86163e9cf5de3100fbca7e8da047b090
|
|
|
|
cv: 79362d7792deb3ca9dc1561b87c82e3cb99eb5837319582216a3226774efa90e
|
|
cmu: fb7bfc79f425644e4e98c2d7d8642b9db82aa739bf2d71cc4117227db227cf0a
|
|
ephemeralKey: 05ad9a95832e23c94f271ca0e4694fac6322282ebac6986b8fdc8ad863084ff1
|
|
encCiphertext: 0fd11e6a13311fb799c79c641d9da43b33e7ad012e28255398789262275f1175be8462c01491c4d842406d0ec4282c9526174a09878fe8fdde33a29604e5e5e7b2a025d6650b97dbb52befb59b1d30a57433b0a351474444099daa371046613260cf3354cfcdada663ece824ffd7e44393886a86165ddddf2b4c41773554c86995269408b11e6737a4c447586f69173446d8e48bf84cbc000a807899973eb93c5e819aad669413f8387933ad1584aa35e43f4ecd1e2d0407c0b1b89920ffdfdb9bea51ac95b557af71b89f903f5d9848f14fcbeb1837570f544d6359eb23faf38a0822da36ce426c4a2fbeffeb0a8a2e297a9d19ba15024590e3329d9fa9261f9938a4032dd34606c9cf9f3dd33e576f05cd1dd6811c6298757d77d9e810abdb226afcaa4346a6560f8932b3181fd355d5d391976183f8d99388839632d6354f666d09d3e5629ea19737388613d38a34fd0f6e50ee5a0cc9677177f50028c141378187bd2819403fc534f80076e9380cb4964d3b6b45819d3b8e9caf54f051852d671bf8c1ffde2d1510756418cb4810936aa57e6965d6fb656a760b7f19adf96c173488552193b147ee58858033dac7cd0eb204c06490bbdedf5f7571acb2ebe76acef3f2a01ee987486dfe6c3f0a5e234c127258f97a28fb5d164a8176be946b8097d0e317287f33bf9c16f9a545409ce29b1f4273725fc0df02a04ebae178b3414fb0a82d50deb09fcf4e6ee9d180ff4f56ff3bc1d3601fc2dc90d814c3256f4967d3a8d64c83fea339c51f5a8e5801fbb97835581b602465dee04b5922c2761b5424
|
|
outCiphertext: 5bec0c9eef2db97d22b2b3556cc969fbb13d06509765a52b3fac54b93f421bf08e18d52ddd52cc1c8ca8adfaccab7e5cc2f4573fbbf8239bb0b8aedbf8dad16282da5c9125dba1c059d0df8abf621078
|
|
zkproof: f02d6c4bc86d40845ac1d59710c45f07d585eb48b32fc0167ba256e73ca3b9311c62d109497957d8dbe10aa3e866b40c0baa2bc492c19ad1e6372d9622bf163fbffeaeee796a3cd9b6fbbfa4d792f34d7fd6e763cd5859dd26833d21d9bc5452bd19515dff9f4995b35bc0c1f876e6ad11f2452dc9ae85aec01fc56f8cbfda75a7727b75ebbd6bbffb43b63a3b1b671e40feb0db002974a3c3b1a788567231bf6399ff89236981149d423802d2341a3bedb9ddcbac1fe7b6435e1479c72e7089
|
|
|
|
cv: b51bfe2ff345857da9b545e88e3221f3f5f72d1e069c9a85dd2236d390989587
|
|
cmu: be005cda16af4408f3ab06a916eeeb9c9594b70424a4c1d171295b6763b22f47
|
|
ephemeralKey: 12ba7beff0ff27883afaff26034b895735709cf937bd2231891e70eb2771e992
|
|
encCiphertext: 7c97f8764eb48e911d428ec8d861b708e8298acb62155145155ae95f0a1d1501034753146e22d05f586d7f6b4fe12dad9a17f5db70b1db96b8d9a83edadc966c8a5466b61fc998c31f1070d9a5c9a6d268d304fe6b8fd3b4010348611abdcbd49fe4f85b623c7828c71382e1034ea67bc8ae97404b0c50b2a04f559e49950afcb0ef462a2ae024b0f0224dfd73684b88c7fbe92d02b68f759c4752663cd7b97a14943649305521326bde085630864629291bae25ff8822a14c4b666a9259ad0dc42a8290ac7bc7f53a16f379f758e5de750f04fd7cad47701c8597f97888bea6fa0bf2999956fbfd0ee68ec36e4688809ae231eb8bc4369f5fe1573f57e099d9c09901bf39caac48dc11956a8ae905ead86954547c448ae43d315e669c4242da565938f417bf43ce7b2b30b1cd4018388e1a910f0fc41fb0877a5925e466819d375b0a912d4fe843b76ef6f223f0f7c894f38f7ab780dfd75f669c8c06cffa43eb47565a50e3b1fa45ad61ce9a1c4727b7aaa53562f523e73952bbf33d8a4104078ade3eaaa49699a69fdf1c5ac7732146ee5e1d6b6ca9b9180f964cc9d0878ae1373524d7d510e58227df6de9d30d271867640177b0f1856e28d5c8afb095ef6184fed651589022eeaea4c0ce1fa6f085092b04979489172b3ef8194a798df5724d6b05f1ae000013a08d612bca8a8c31443c10346dbf61de8475c0bbec5104b47556af3d514458e2321d146071789d2335934a680614e83562f82dfd405b54a45eb32c165448d4d5d61ca2859585369f53f1a137e9e82b67b8fdaf01bda54a31731189
|
|
outCiphertext: 6ae10280a032440c420a421e944d1e952b70d5826cd3b08b7db9630fe4fd5f22125de840fcc40b98038af11d55be25432597b4b65b9ec1c7a8bbfd052cbf7e1c1785314934b262d5853754f1f17771cf
|
|
zkproof: b7503072655753fa3f54ecc587e9f83b581916092df26e63e18994cb0db91a0bbdc7b6119b32222adf5e61d8d8ae89dae4954b54813bb33f08d562ba513fee1b09c0fcd516055419474dd7fda038a89c84ea7b9468287f0eb0c10c4b132520194d3d8d5351fc10d09c15c8cc101aa1663bbf17b84111f38bb439f07353bdea3596d15e713e1e2e7d3f1c383135b47fa7f81f46df7a902a404699ec912f5656c35b85763e4de583aecaa1dfd5d2677d9c8ffee877f63f40a5ca0d67f6e5541247
|
|
|
|
vJoinSplit: 00
|
|
|
|
bindingSig: f805af876aeede53aa8b0f8e5604a73c30cbd09dad963d6f8a5dcc40def40797342113ba206fae8ebe4f3bc3caf69259e462eff9ba8b3f4bfaa1300c26925a87</code></pre>
|
|
<p>Transaction digest with <code>nIn = NOT_AN_INPUT</code> and <code>nHashType = 1</code> (<code>SIGHASH_ALL</code>):</p>
|
|
<pre><code>hashPrevouts:
|
|
BLAKE2b-256('ZcashPrevoutHash', '')
|
|
= d53a633bbecf82fe9e9484d8a0e727c73bb9e68c96e72dec30144f6a84afa136
|
|
|
|
hashSequence:
|
|
BLAKE2b-256('ZcashSequencHash', '')
|
|
= a5f25f01959361ee6eb56a7401210ee268226f6ce764a4f10b7f29e54db37272
|
|
|
|
hashOutputs:
|
|
BLAKE2b-256('ZcashOutputsHash', e7719811893e0000095200ac6551ac636565b2835a0805750200025151)
|
|
= ab6f7f6c5ad6b56357b5f37e16981723db6c32411753e28c175e15589172194a
|
|
|
|
hashShieldedSpends:
|
|
BLAKE2b-256('ZcashSSpendsHash', 1b3d1a027c2c40590958b7eb13d742a997738c46a458965baf276ba92f272c721fe01f7e9c8e36d6a5e29d4e30a73594bf5098421c69378af1e40f64e125946f62c2fa7b2fecbcb64b6968912a6381ce3dc166d56a1d62f5a8d7551db5fd931325c9a138f49b1a537edcf04be34a9851a7af9db6990ed83dd64af3597c04323ea51b0052ad8084a8b9da948d320dadd64f5431e61ddf658d24ae67c22c8d1309131fc00fe7f235734276d38d47f1e191e00c7a1d48af046827591e9733a97fa6b679f3dc601d008285edcbdae69ce8fc1be4aac00ff2711ebd931de518856878f73476f21a482ec9378365c8f7393c94e2885315eb4671098b79535e790fe53e29fef2b3766697ac32b4f473f468a008e72389fc03880d780cb07fcfaabe3f1a84b27db59a4a153d882d2b2103596555ed9494c6ac893c49723833ec8926c1035a4b7be1769367e1fe8ad18de11e58d88a0ad5511d3525122b7b0a6f25d28b16457e745939ffedbd12863ce71a02af117d417adb3d15cc54dcb1fce467500c6b8fb86b12b56da9c382857deecc40a98d5f2935395ee4762dd21afdbb5d47fa9a6dd984d567db2857b927b7fae2db587105415d4642789d38f50b8dbcc129cab3d17d19f3355bcf73cecb8cb8a5da01307152f13936a270572670dc82d39026c6cb4cd4b0f7f5aa2a4f5a5341ec5dd715406f2fdd2afa733f5f641c8c21862a1bafce2609d9eecfa158cfb5cd79f88008e315dc7d8388e76c1782fd2795d18a763624c25fa959cc97489ce75745824b77868c53239cfbdf73caec65604037314faaceb56218c6bd30f8374ac13386793f21a9fb80ad03bc0cda4a44946c00e1b1a1df0e5b87b5bece477a709649e950060591394812951e1fe3895b8cc3d14d2c6b4cbc4b700a364fa76bd8298bc3ec608d4cf7f3566658d5588714ec9448b0f0396128aef884a646114c9f1a6df56319033c3199cc7a09e9e9567482c92695390229407bbc48985675e3f874a4533f1d63a84dfa3e0f460fe2f57e34fbc75423b6883a50a0d470190dfba10a857f82842d3825b3d6da0573d316eb160dc0b716c48fbd467f75b780149ae8808f4e68f50c0536acddf6f1aeab016b6bc1ec144b4e553acfd670f77e755fc88e0677e31ba459b44e307768958fe3789d41c2b1ff434cb30e15914f01bc6bc2307b488d2556d7b7380ea4ffd712f6b02fe806b94569cd4059f396bf29b99d0a40e5e1711ca944f72d436a102fca4b97693da0b086fe9d2e7162470d02e0f05d4bec9512bfb3f38327296efaa74328b118c27402c70c3a90b49ad4bbc68e37c0aa7d9b3fe17799d73b841e751713a02943905aae08)
|
|
= 3fd9edb96dccf5b9aeb71e3db3710e74be4f1dfb19234c1217af26181f494a36
|
|
|
|
hashShieldedOutputs:
|
|
BLAKE2b-256('ZcashSOutputHash', 4999c538f7a758bb5b1d28fd218fba1938744bdb77b4a4dfa7a5fae96e8cd49b26907dfc6685c5c99b7141ac626ab4761fd3f41e728e1a28f89db89ffdeca364e4b22d81d9968d0119e4c7a189adf22ad96830a54e40dc73eaba6b2aaf14f7ca942e7370b247c046f8e75ef8e3f8bd821cf577491864e20e6d08fd2e32b555c92c661f19588b72a89599710a88061253ca285b6304b37da2b5294f5cb354a894322848ccbdc7c2545b7da568afac87ffa005c312241c2d57f4b45d6419f0d2e2c5af33ae243785b325cdab95404fc7aed70525cddb41872cfcc214b13232edc78609753dbff930eb0dc156612b9cb434bc4b693392deb87c530435312edcedc6a961133338d786c4a3e103f60110a16b1337129704bf4754ff6ba9fbe65951e610620f71cda8fc877625f2c5bb04cbe1228b1e886f4050afd8fe94e97d2e9e85c6bb748c0042d3249abb1342bb0eebf62058bf3de080d94611a3750915b5dc6c0b3899d41222bace760ee9c8818ded599e34c56d7372af1eb86852f2a732104bdb750739de6c2c6e0f9eb7cb17f1942bfc9f4fd6ebb6b4cdd4da2bca26fac4578e9f543405acc7d86ff59158bd0cba3aef6f4a8472d144d99f8b8d1dedaa9077d4f01d4bb27bbe31d88fbefac3dcd4797563a26b1d61fcd9a464ab21ed550fe6fa09695ba0b2f10eea6468cc6e20a66f826e3d14c5006f0563887f5e1289be1b2004caca8d3f34d6e84bf59c1e04619a7c23a996941d889e4622a9b9b1d59d5e319094318cd405ba27b7e2c084762d31453ec4549a4d97729d033460fcf89d6494f2ffd789e98082ea5ce9534b3acd60fe49e37e4f666931677319ed89f85588741b3128901a93bd78e4be0225a9e2692c77c969ed0176bdf9555948cbd5a332d045de6ba6bf4490adfe7444cd467a09075417fcc0062e49f008c51ad4227439c1b4476ccd8e97862dab7be1e8d399c05ef27c6e22ee273e15786e394c8f1be31682a30147963ac8da8d41d804258426a3f70289b8ad19d8de13be4eebe3bd4c8a6f55d6e0c373d456851879f5fbc282db9e134806bff71e11bc33ab75dd6ca067fb73a043b646a7cf39cab4928386786d2f24141ee120fdc34d6764eafc66880ee0204f53cc1167ed20b43a52dea3ca7cff8ef35cd8e6d7c111a68ef44bcd0c1513ad47ca61c659cc5d325b440f6b9f59aff66879bb6688fd2859362b182f207b3175961f6411a493bffd048e7d0d87d82fe6f990a2b0a25f5aa0111a6e68f37bf6f3ac2d26b84686e569d58d99c1383597fad81193c4c1b16e6a90e2d507cdfe6fbdaa86163e9cf5de3100fbca7e8da047b09079362d7792deb3ca9dc1561b87c82e3cb99eb5837319582216a3226774efa90efb7bfc79f425644e4e98c2d7d8642b9db82aa739bf2d71cc4117227db227cf0a05ad9a95832e23c94f271ca0e4694fac6322282ebac6986b8fdc8ad863084ff10fd11e6a13311fb799c79c641d9da43b33e7ad012e28255398789262275f1175be8462c01491c4d842406d0ec4282c9526174a09878fe8fdde33a29604e5e5e7b2a025d6650b97dbb52befb59b1d30a57433b0a351474444099daa371046613260cf3354cfcdada663ece824ffd7e44393886a86165ddddf2b4c41773554c86995269408b11e6737a4c447586f69173446d8e48bf84cbc000a807899973eb93c5e819aad669413f8387933ad1584aa35e43f4ecd1e2d0407c0b1b89920ffdfdb9bea51ac95b557af71b89f903f5d9848f14fcbeb1837570f544d6359eb23faf38a0822da36ce426c4a2fbeffeb0a8a2e297a9d19ba15024590e3329d9fa9261f9938a4032dd34606c9cf9f3dd33e576f05cd1dd6811c6298757d77d9e810abdb226afcaa4346a6560f8932b3181fd355d5d391976183f8d99388839632d6354f666d09d3e5629ea19737388613d38a34fd0f6e50ee5a0cc9677177f50028c141378187bd2819403fc534f80076e9380cb4964d3b6b45819d3b8e9caf54f051852d671bf8c1ffde2d1510756418cb4810936aa57e6965d6fb656a760b7f19adf96c173488552193b147ee58858033dac7cd0eb204c06490bbdedf5f7571acb2ebe76acef3f2a01ee987486dfe6c3f0a5e234c127258f97a28fb5d164a8176be946b8097d0e317287f33bf9c16f9a545409ce29b1f4273725fc0df02a04ebae178b3414fb0a82d50deb09fcf4e6ee9d180ff4f56ff3bc1d3601fc2dc90d814c3256f4967d3a8d64c83fea339c51f5a8e5801fbb97835581b602465dee04b5922c2761b54245bec0c9eef2db97d22b2b3556cc969fbb13d06509765a52b3fac54b93f421bf08e18d52ddd52cc1c8ca8adfaccab7e5cc2f4573fbbf8239bb0b8aedbf8dad16282da5c9125dba1c059d0df8abf621078f02d6c4bc86d40845ac1d59710c45f07d585eb48b32fc0167ba256e73ca3b9311c62d109497957d8dbe10aa3e866b40c0baa2bc492c19ad1e6372d9622bf163fbffeaeee796a3cd9b6fbbfa4d792f34d7fd6e763cd5859dd26833d21d9bc5452bd19515dff9f4995b35bc0c1f876e6ad11f2452dc9ae85aec01fc56f8cbfda75a7727b75ebbd6bbffb43b63a3b1b671e40feb0db002974a3c3b1a788567231bf6399ff89236981149d423802d2341a3bedb9ddcbac1fe7b6435e1479c72e7089b51bfe2ff345857da9b545e88e3221f3f5f72d1e069c9a85dd2236d390989587be005cda16af4408f3ab06a916eeeb9c9594b70424a4c1d171295b6763b22f4712ba7beff0ff27883afaff26034b895735709cf937bd2231891e70eb2771e9927c97f8764eb48e911d428ec8d861b708e8298acb62155145155ae95f0a1d1501034753146e22d05f586d7f6b4fe12dad9a17f5db70b1db96b8d9a83edadc966c8a5466b61fc998c31f1070d9a5c9a6d268d304fe6b8fd3b4010348611abdcbd49fe4f85b623c7828c71382e1034ea67bc8ae97404b0c50b2a04f559e49950afcb0ef462a2ae024b0f0224dfd73684b88c7fbe92d02b68f759c4752663cd7b97a14943649305521326bde085630864629291bae25ff8822a14c4b666a9259ad0dc42a8290ac7bc7f53a16f379f758e5de750f04fd7cad47701c8597f97888bea6fa0bf2999956fbfd0ee68ec36e4688809ae231eb8bc4369f5fe1573f57e099d9c09901bf39caac48dc11956a8ae905ead86954547c448ae43d315e669c4242da565938f417bf43ce7b2b30b1cd4018388e1a910f0fc41fb0877a5925e466819d375b0a912d4fe843b76ef6f223f0f7c894f38f7ab780dfd75f669c8c06cffa43eb47565a50e3b1fa45ad61ce9a1c4727b7aaa53562f523e73952bbf33d8a4104078ade3eaaa49699a69fdf1c5ac7732146ee5e1d6b6ca9b9180f964cc9d0878ae1373524d7d510e58227df6de9d30d271867640177b0f1856e28d5c8afb095ef6184fed651589022eeaea4c0ce1fa6f085092b04979489172b3ef8194a798df5724d6b05f1ae000013a08d612bca8a8c31443c10346dbf61de8475c0bbec5104b47556af3d514458e2321d146071789d2335934a680614e83562f82dfd405b54a45eb32c165448d4d5d61ca2859585369f53f1a137e9e82b67b8fdaf01bda54a317311896ae10280a032440c420a421e944d1e952b70d5826cd3b08b7db9630fe4fd5f22125de840fcc40b98038af11d55be25432597b4b65b9ec1c7a8bbfd052cbf7e1c1785314934b262d5853754f1f17771cfb7503072655753fa3f54ecc587e9f83b581916092df26e63e18994cb0db91a0bbdc7b6119b32222adf5e61d8d8ae89dae4954b54813bb33f08d562ba513fee1b09c0fcd516055419474dd7fda038a89c84ea7b9468287f0eb0c10c4b132520194d3d8d5351fc10d09c15c8cc101aa1663bbf17b84111f38bb439f07353bdea3596d15e713e1e2e7d3f1c383135b47fa7f81f46df7a902a404699ec912f5656c35b85763e4de583aecaa1dfd5d2677d9c8ffee877f63f40a5ca0d67f6e5541247)
|
|
= dafece799f638ba7268bf8fe43f02a5112f0bb32a84c4a8c2f508c41ff1c78b5
|
|
|
|
Preimage:
|
|
0400008085202f89d53a633bbecf82fe9e9484d8a0e727c73bb9e68c96e72dec30144f6a84afa136a5f25f01959361ee6eb56a7401210ee268226f6ce764a4f10b7f29e54db37272ab6f7f6c5ad6b56357b5f37e16981723db6c32411753e28c175e15589172194a00000000000000000000000000000000000000000000000000000000000000003fd9edb96dccf5b9aeb71e3db3710e74be4f1dfb19234c1217af26181f494a36dafece799f638ba7268bf8fe43f02a5112f0bb32a84c4a8c2f508c41ff1c78b5481cdd86b3cc4318442117623ceb050001000000
|
|
|
|
header: 04000080
|
|
nVersionGroupId: 85202f89
|
|
hashPrevouts: d53a633bbecf82fe9e9484d8a0e727c73bb9e68c96e72dec30144f6a84afa136
|
|
hashSequence: a5f25f01959361ee6eb56a7401210ee268226f6ce764a4f10b7f29e54db37272
|
|
hashOutputs: ab6f7f6c5ad6b56357b5f37e16981723db6c32411753e28c175e15589172194a
|
|
hashJoinSplits: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashShieldedSpends: 3fd9edb96dccf5b9aeb71e3db3710e74be4f1dfb19234c1217af26181f494a36
|
|
hashShieldedOutputs: dafece799f638ba7268bf8fe43f02a5112f0bb32a84c4a8c2f508c41ff1c78b5
|
|
nLockTime: 481cdd86
|
|
nExpiryHeight: b3cc4318
|
|
valueBalance: 442117623ceb0500
|
|
nHashType: 01000000
|
|
|
|
sighash: 63d18534de5f2d1c9e169b73f9c783718adbef5c8a7d55b5e7a37affa1dd3ff3</code></pre>
|
|
<h2 id="test-vector-2">Test vector 2</h2>
|
|
<p>Raw transaction:</p>
|
|
<pre><code>0400008085202f89020bbe32a598c22adfb48cef72ba5d4287c0cefbacfd8ce195b4963c34a94bba7a175dae4b0465ac656353708915090f47a068e227433f9e49d3aa09e356d8d66d0c0121e91a3c4aa3f27fa1b63396e2b41d090063535300ac53ac514e97056802da071b970d4807000152a844550bdc2002000752526a65520052d7034302011b9a076620edc067ff0200000353e3b8a71face1c9f37745ed36883529304bfd5a390b37bc5a3445241f03f64a818820dfeddd75375159fbd21eca9872104f8d7b3c8c869703a1e7848a5c941e45a9c7943446d0dc9627cb31f80e7aa596d4821dc99a7d777cd57e194842a023471f0f6288a150647b2afe9df7cccf01f5cde5f04680bbfed87f6cf429fb27ad6babe791766611cf5bc20e48bef119259b9b8a0e39c3df28cb9582ea338601cdc481b32fb82adeebb3dade25d1a3df20c37e712506b5d996c49a9f0f30ddcb91fe9004e1e83294a6c9203d94e8dc2cbb449de4155032604e47997016b304fd437d8235045e255a19b743a0a9f2e336b44cae307bb3987bd3e4e777fbb34c0ab8cc3d67466c0a88dd4ccad18a07a8d1068df5b629e5718d0f6df5c957cf71bb00a5178f175caca944e635c5159f738e2402a2d21aa081e10e456afb00b9f62416c8b9c0f7228f510729e0be3f305313d77f7379dc2af24869c6c74ee4471498861d192f0ff0f508285dab6b6a36ccf7d12256cc76b95503720ac672d08268d2cf7773b6ba2a5f664847bf707f2fc10c98f2f006ec22ccb5a8c8b7c40c7c2d49a6639b9f2ce33c25c04bc461e744dfa536b00d94baddf4f4d14044c695a33881477df124f0fcf206a9fb2e65e304cdbf0c4d2390170c130ab849c2f22b5cdd3921640c8cf1976ae1010b0dfd9cb2543e45f99749cc4d61f2e8aabfe98bd905fa39951b33ea769c45ab9531c57209862ad12fd76ba4807e65417b6cd12fa8ec916f013ebb8706a96effeda06c4be24b04846392e9d1e6930eae01fa21fbd700583fb598b92c8f4eb8a61aa6235db60f2841cf3a1c6ab54c67066844711d091eb931a1bd6281aedf2a0e8fab18817202a9be06402ed9cc720c16bfe881e4df4255e87afb7fc62f38116bbe03cd8a3cb11a27d568414782f47b1a44c97c680467694bc9709d32916c97e8006cbb07ba0e4180a3738038c374c4cce8f32959afb25f303f5815c4533124acf9d18940e77522ac5dc4b9570aae8f47b7f57fd8767bea1a24ae7bed65b4afdc8f1278c30e2db98fd172730ac6bbed4f1127cd32b04a95b205526cfcb4c4e1cc955175b3e8de1f5d81b18669692350aaa1a1d797617582e54d7a5b57a683b32fb1098062dad7b0c2eb518f6862e83db25e3dbaf7aed504de932acb99d735992ce62bae9ef893ff6acc0ffcf8e3483e146b9d49dd8c7835f43a37dca0787e3ec9f6605223d5ba7ae0ab9025b73bc03f7fac36c009a56d4d95d1e81d3b3ebca7e54cc1a12d127b57c8138976e791013b015f06a624f521b6ee04ec980893c7e5e01a336203594094f82833d74427880084d35863c8e7ebb5c9eed98e72572ec40c79b26623b58022f489b0893d88be63f3f8c0d23249ebcde13db9312941c36c1d1cbcabac0c78cb3b1912db0dcbfe1893d9b51be4af1d000bac1ad0a3ae2ce1e73225fb114d05af4cefc06e875f074ffeae0cba7da3a516c173be1c513323e119f635e8209a074b216b7023fadc2d25949c90037e71e3e550726d210a2c688342e52440635e9cc14afe10102621a9c9accb782e9e4a5fa87f0a956f5b85509960285c22627c59483a5a4c28cce4b156e551406a7ee8355656a21e43e38ce129fdadb759eddfa08f00fc8e567cef93c6792d01df05e6d580f4d5d48df042451a33590d3e8cf49b2627218f0c292fa66ada945fa55bb23548e33a83a562957a3149a993cc472362298736a8b778d97ce423013d64b32cd172efa551bf7f368f04bdaec6091a3004a757598b801dcf675cb83e43a53ae8b254d333bcda20d4817d3477abfba25bb83df5949c126f149b1d99341e4e6f9120f4d41e629185002c72c012c414d2382a6d47c7b3deaba770c400ca96b2814f6b26c3ef17429f1a98c85d83db20efad48be8996fb1bff591efff360fe1199056c56e5feec61a7b8b9f699d6012c2849232f329fef95c7af370098ffe4918e0ca1df47f275867b739e0a514d3209325e217045927b479c1ce2e5d54f25488cad1513e3f44a21266cfd841633327dee6cf810fbf7393e317d9e53d1be1d5ae7839b66b943b9ed18f2c530e975422332c3439cce49a29f2a336a4851263c5e9bd13d731109e844b7f8c392a5c1dcaa2ae5f50ff63fab9765e016702c35a67cd7364d3fab552fb349e35c15c50250453fd18f7b855992632e2c76c0fbf1ef963ea80e3223de3277bc559251725829ec03f213ba8955cab2822ff21a9b0a4904d668fcd77224bde3dd01f6ffc4828f6b64230b35c6a049873494276ea1d7ed5e92cb4f90ba83a9e49601b194042f2900d99d312d7b70508cf176066d154dbe96ef9d4367e4c840e4a17b5e5122e8ebe2158a3c5f4cbae21ea3fa1ae6c25a9462ebcbb0fd5f14554bc97747c33e34da90c816d8d0d50bfe37618c5812891484fa259322c15092d4155d8696d6f12f24fd364496b3be0871ca3dd9625348a614b59bde45885649bae36de34def8fcec85343475d976ae1e9b27829ce2ac5efd0b399a8b448be6504294ee6b3c1c6a5342d7c01ae9d8ad3070c2b1a91573af5e0c5e4cbbf4acdc6b54c9272200d9970250c17c1036f06085c41858ed3a0c48150bc697e4a695fef335f7ad07e1a46dc767ff822db70e6669080b9816b2232c81a4c66cc586abfe1eaa8ca6cf41fc30eb8dc57c37a3c39c59c94232df9d388dbfa35c2cd5c75f328e9fea78f65568f2bb934c82c4142da69d12ca7de9a7df706400ec79878d868e17e8f71ea31495a8bae7bdc2e48b5118771c2fca078cca1fce0d7ef0af3478cf36f69e85a41dd29b4294a65d3e055ff718dd9dc8c75e7e5b2efe442637371b7c48f6ee99e3ea38a4b0f2f67fc2b908cda657eae754e037e262e9a9f9bd7ec4267ed8e96930e1084783c37d6f9dd15fd29f4cc477e66f130d630430dcc0104899b4f9f46eb090ef7fc90b479abf61f93955ee00e6a1848f1ab14ad334f2b68035808cdf1bb9e9d9a816baf728a955b960b7701fa626687dc3c9cba646337b53e29816e9482ddf5578a8768aae477fce410ac2d5de6095861c111d7feb3e6bb4fbb5a54955495972798350a253f05f66c2ecfcbc0ed43f5ec2e6d8dba15a51254d97b1821107c07dd9a16ef8406f943e282b95d4b362530c913d6ba421df6027de5af1e4745d5868106954be6c1962780a2941072e95131b1679df0637625042c37d48ffb152e5ebc185c8a2b7d4385f1c95af937df78dfd8757fab434968b0b57c66574468f160b447ac8221e5060676a842a1c6b7172dd3340f764070ab1fe091c5c74c95a5dc043390723a4c127da14cdde1dc2675a62340b3e6afd0522a31de26e7d1ec3a9c8a091ffdc75b7ecfdc7c12995a5e37ce3488bd29f8629d68f696492448dd526697476dc061346ebe3f677217ff9c60efce943af28dfd3f9e59692598a6047c23c4c01400f1ab5730eac0ae8d5843d5051c376240172af218d7a1ecfe65b4f75100638983c14de4974755dade8018c9b8f4543fb095961513e67c61dbc59c607f9b51f8d09bdcad28bcfb9e5d2744ea8848b2623ac07f8ef61a81a35910b8a1baf39a919a7b60bc604d63185f759221d847cc54a22765a4c33475b5791e9af3271fc8d9350667090d8184ec50522d804f23c4fb44ffa481bc92ae408d1b9f2b131904f9705c59e2f4bde7a3b2c085d93fd2abc5e14d163001a12f51938d021afa92239b873dc6c357eaa8af4ee6d00540657fe32914103b5d98f68bd3e2b5359f08ccd88d0c811e4c31fbb49f3a90bbd05dce62f344e7077593159ae35050b04c9e6b86bc432dc8b048c73c0018ca5b69411297732a4e1aa99a928c71e7a24fd277856aa42501e51b012aea9446a2104e93f815a0b3a29b458314f3d8be2b9823d342f46213e942a7e19a46e970b5c506708430317b1bb3b35df68ae33a4926a03e6bfeb5510416fcbb0524c9ca5074156cc5a5d6fe1c995edc60a2f550411aa41e3da3bdcf64bcf04a0510571b936d47e55cec0330008dfe73563404f047d7f3a8a3d7743bc554955210f1eb0d08599ea77d5f974d87176d37d98b9c0ad440407209ed6a9f08464d565593e1a63b938536b49244e97d
|
|
|
|
header: 04000080
|
|
nVersionGroupId: 85202f89
|
|
vin: 02 0bbe32a598c22adfb48cef72ba5d4287c0cefbacfd8ce195b4963c34a94bba7a 175dae4b 0465ac6563 53708915
|
|
090f47a068e227433f9e49d3aa09e356d8d66d0c0121e91a3c4aa3f27fa1b633 96e2b41d 090063535300ac53ac51 4e970568
|
|
vout: 02 da071b970d480700 0152
|
|
a844550bdc200200 0752526a65520052
|
|
nLockTime: d7034302
|
|
nExpiryHeight: 011b9a07
|
|
valueBalance: 6620edc067ff0200
|
|
vShieldedSpend: 00
|
|
|
|
vShieldedOutput: 03
|
|
cv: 53e3b8a71face1c9f37745ed36883529304bfd5a390b37bc5a3445241f03f64a
|
|
cmu: 818820dfeddd75375159fbd21eca9872104f8d7b3c8c869703a1e7848a5c941e
|
|
ephemeralKey: 45a9c7943446d0dc9627cb31f80e7aa596d4821dc99a7d777cd57e194842a023
|
|
encCiphertext: 471f0f6288a150647b2afe9df7cccf01f5cde5f04680bbfed87f6cf429fb27ad6babe791766611cf5bc20e48bef119259b9b8a0e39c3df28cb9582ea338601cdc481b32fb82adeebb3dade25d1a3df20c37e712506b5d996c49a9f0f30ddcb91fe9004e1e83294a6c9203d94e8dc2cbb449de4155032604e47997016b304fd437d8235045e255a19b743a0a9f2e336b44cae307bb3987bd3e4e777fbb34c0ab8cc3d67466c0a88dd4ccad18a07a8d1068df5b629e5718d0f6df5c957cf71bb00a5178f175caca944e635c5159f738e2402a2d21aa081e10e456afb00b9f62416c8b9c0f7228f510729e0be3f305313d77f7379dc2af24869c6c74ee4471498861d192f0ff0f508285dab6b6a36ccf7d12256cc76b95503720ac672d08268d2cf7773b6ba2a5f664847bf707f2fc10c98f2f006ec22ccb5a8c8b7c40c7c2d49a6639b9f2ce33c25c04bc461e744dfa536b00d94baddf4f4d14044c695a33881477df124f0fcf206a9fb2e65e304cdbf0c4d2390170c130ab849c2f22b5cdd3921640c8cf1976ae1010b0dfd9cb2543e45f99749cc4d61f2e8aabfe98bd905fa39951b33ea769c45ab9531c57209862ad12fd76ba4807e65417b6cd12fa8ec916f013ebb8706a96effeda06c4be24b04846392e9d1e6930eae01fa21fbd700583fb598b92c8f4eb8a61aa6235db60f2841cf3a1c6ab54c67066844711d091eb931a1bd6281aedf2a0e8fab18817202a9be06402ed9cc720c16bfe881e4df4255e87afb7fc62f38116bbe03cd8a3cb11a27d568414782f47b1a44c97c680467694bc9709d32
|
|
outCiphertext: 916c97e8006cbb07ba0e4180a3738038c374c4cce8f32959afb25f303f5815c4533124acf9d18940e77522ac5dc4b9570aae8f47b7f57fd8767bea1a24ae7bed65b4afdc8f1278c30e2db98fd172730a
|
|
zkproof: c6bbed4f1127cd32b04a95b205526cfcb4c4e1cc955175b3e8de1f5d81b18669692350aaa1a1d797617582e54d7a5b57a683b32fb1098062dad7b0c2eb518f6862e83db25e3dbaf7aed504de932acb99d735992ce62bae9ef893ff6acc0ffcf8e3483e146b9d49dd8c7835f43a37dca0787e3ec9f6605223d5ba7ae0ab9025b73bc03f7fac36c009a56d4d95d1e81d3b3ebca7e54cc1a12d127b57c8138976e791013b015f06a624f521b6ee04ec980893c7e5e01a336203594094f82833d744
|
|
|
|
cv: 27880084d35863c8e7ebb5c9eed98e72572ec40c79b26623b58022f489b0893d
|
|
cmu: 88be63f3f8c0d23249ebcde13db9312941c36c1d1cbcabac0c78cb3b1912db0d
|
|
ephemeralKey: cbfe1893d9b51be4af1d000bac1ad0a3ae2ce1e73225fb114d05af4cefc06e87
|
|
encCiphertext: 5f074ffeae0cba7da3a516c173be1c513323e119f635e8209a074b216b7023fadc2d25949c90037e71e3e550726d210a2c688342e52440635e9cc14afe10102621a9c9accb782e9e4a5fa87f0a956f5b85509960285c22627c59483a5a4c28cce4b156e551406a7ee8355656a21e43e38ce129fdadb759eddfa08f00fc8e567cef93c6792d01df05e6d580f4d5d48df042451a33590d3e8cf49b2627218f0c292fa66ada945fa55bb23548e33a83a562957a3149a993cc472362298736a8b778d97ce423013d64b32cd172efa551bf7f368f04bdaec6091a3004a757598b801dcf675cb83e43a53ae8b254d333bcda20d4817d3477abfba25bb83df5949c126f149b1d99341e4e6f9120f4d41e629185002c72c012c414d2382a6d47c7b3deaba770c400ca96b2814f6b26c3ef17429f1a98c85d83db20efad48be8996fb1bff591efff360fe1199056c56e5feec61a7b8b9f699d6012c2849232f329fef95c7af370098ffe4918e0ca1df47f275867b739e0a514d3209325e217045927b479c1ce2e5d54f25488cad1513e3f44a21266cfd841633327dee6cf810fbf7393e317d9e53d1be1d5ae7839b66b943b9ed18f2c530e975422332c3439cce49a29f2a336a4851263c5e9bd13d731109e844b7f8c392a5c1dcaa2ae5f50ff63fab9765e016702c35a67cd7364d3fab552fb349e35c15c50250453fd18f7b855992632e2c76c0fbf1ef963ea80e3223de3277bc559251725829ec03f213ba8955cab2822ff21a9b0a4904d668fcd77224bde3dd01f6ffc4828f6b64230b35c6a049873494276ea1
|
|
outCiphertext: d7ed5e92cb4f90ba83a9e49601b194042f2900d99d312d7b70508cf176066d154dbe96ef9d4367e4c840e4a17b5e5122e8ebe2158a3c5f4cbae21ea3fa1ae6c25a9462ebcbb0fd5f14554bc97747c33e
|
|
zkproof: 34da90c816d8d0d50bfe37618c5812891484fa259322c15092d4155d8696d6f12f24fd364496b3be0871ca3dd9625348a614b59bde45885649bae36de34def8fcec85343475d976ae1e9b27829ce2ac5efd0b399a8b448be6504294ee6b3c1c6a5342d7c01ae9d8ad3070c2b1a91573af5e0c5e4cbbf4acdc6b54c9272200d9970250c17c1036f06085c41858ed3a0c48150bc697e4a695fef335f7ad07e1a46dc767ff822db70e6669080b9816b2232c81a4c66cc586abfe1eaa8ca6cf41fc3
|
|
|
|
cv: 0eb8dc57c37a3c39c59c94232df9d388dbfa35c2cd5c75f328e9fea78f65568f
|
|
cmu: 2bb934c82c4142da69d12ca7de9a7df706400ec79878d868e17e8f71ea31495a
|
|
ephemeralKey: 8bae7bdc2e48b5118771c2fca078cca1fce0d7ef0af3478cf36f69e85a41dd29
|
|
encCiphertext: b4294a65d3e055ff718dd9dc8c75e7e5b2efe442637371b7c48f6ee99e3ea38a4b0f2f67fc2b908cda657eae754e037e262e9a9f9bd7ec4267ed8e96930e1084783c37d6f9dd15fd29f4cc477e66f130d630430dcc0104899b4f9f46eb090ef7fc90b479abf61f93955ee00e6a1848f1ab14ad334f2b68035808cdf1bb9e9d9a816baf728a955b960b7701fa626687dc3c9cba646337b53e29816e9482ddf5578a8768aae477fce410ac2d5de6095861c111d7feb3e6bb4fbb5a54955495972798350a253f05f66c2ecfcbc0ed43f5ec2e6d8dba15a51254d97b1821107c07dd9a16ef8406f943e282b95d4b362530c913d6ba421df6027de5af1e4745d5868106954be6c1962780a2941072e95131b1679df0637625042c37d48ffb152e5ebc185c8a2b7d4385f1c95af937df78dfd8757fab434968b0b57c66574468f160b447ac8221e5060676a842a1c6b7172dd3340f764070ab1fe091c5c74c95a5dc043390723a4c127da14cdde1dc2675a62340b3e6afd0522a31de26e7d1ec3a9c8a091ffdc75b7ecfdc7c12995a5e37ce3488bd29f8629d68f696492448dd526697476dc061346ebe3f677217ff9c60efce943af28dfd3f9e59692598a6047c23c4c01400f1ab5730eac0ae8d5843d5051c376240172af218d7a1ecfe65b4f75100638983c14de4974755dade8018c9b8f4543fb095961513e67c61dbc59c607f9b51f8d09bdcad28bcfb9e5d2744ea8848b2623ac07f8ef61a81a35910b8a1baf39a919a7b60bc604d63185f759221d847cc54a22765a4c33475b5791e9af3271fc8d93506
|
|
outCiphertext: 67090d8184ec50522d804f23c4fb44ffa481bc92ae408d1b9f2b131904f9705c59e2f4bde7a3b2c085d93fd2abc5e14d163001a12f51938d021afa92239b873dc6c357eaa8af4ee6d00540657fe32914
|
|
zkproof: 103b5d98f68bd3e2b5359f08ccd88d0c811e4c31fbb49f3a90bbd05dce62f344e7077593159ae35050b04c9e6b86bc432dc8b048c73c0018ca5b69411297732a4e1aa99a928c71e7a24fd277856aa42501e51b012aea9446a2104e93f815a0b3a29b458314f3d8be2b9823d342f46213e942a7e19a46e970b5c506708430317b1bb3b35df68ae33a4926a03e6bfeb5510416fcbb0524c9ca5074156cc5a5d6fe1c995edc60a2f550411aa41e3da3bdcf64bcf04a0510571b936d47e55cec0330
|
|
|
|
vJoinSplit: 00
|
|
bindingSig: 8dfe73563404f047d7f3a8a3d7743bc554955210f1eb0d08599ea77d5f974d87176d37d98b9c0ad440407209ed6a9f08464d565593e1a63b938536b49244e97d</code></pre>
|
|
<p>Transaction digest with <code>nIn = 0</code> and <code>nHashType = 2</code> (<code>SIGHASH_NONE</code>):</p>
|
|
<pre><code>hashPrevouts:
|
|
BLAKE2b-256('ZcashPrevoutHash', 0bbe32a598c22adfb48cef72ba5d4287c0cefbacfd8ce195b4963c34a94bba7a175dae4b090f47a068e227433f9e49d3aa09e356d8d66d0c0121e91a3c4aa3f27fa1b63396e2b41d)
|
|
= cacf0f5210cce5fa65a59f314292b3111d299e7d9d582753cf61e1e408552ae4
|
|
|
|
hashShieldedOutputs:
|
|
BLAKE2b-256(b'ZcashSOutputHash', 53e3b8a71face1c9f37745ed36883529304bfd5a390b37bc5a3445241f03f64a818820dfeddd75375159fbd21eca9872104f8d7b3c8c869703a1e7848a5c941e45a9c7943446d0dc9627cb31f80e7aa596d4821dc99a7d777cd57e194842a023471f0f6288a150647b2afe9df7cccf01f5cde5f04680bbfed87f6cf429fb27ad6babe791766611cf5bc20e48bef119259b9b8a0e39c3df28cb9582ea338601cdc481b32fb82adeebb3dade25d1a3df20c37e712506b5d996c49a9f0f30ddcb91fe9004e1e83294a6c9203d94e8dc2cbb449de4155032604e47997016b304fd437d8235045e255a19b743a0a9f2e336b44cae307bb3987bd3e4e777fbb34c0ab8cc3d67466c0a88dd4ccad18a07a8d1068df5b629e5718d0f6df5c957cf71bb00a5178f175caca944e635c5159f738e2402a2d21aa081e10e456afb00b9f62416c8b9c0f7228f510729e0be3f305313d77f7379dc2af24869c6c74ee4471498861d192f0ff0f508285dab6b6a36ccf7d12256cc76b95503720ac672d08268d2cf7773b6ba2a5f664847bf707f2fc10c98f2f006ec22ccb5a8c8b7c40c7c2d49a6639b9f2ce33c25c04bc461e744dfa536b00d94baddf4f4d14044c695a33881477df124f0fcf206a9fb2e65e304cdbf0c4d2390170c130ab849c2f22b5cdd3921640c8cf1976ae1010b0dfd9cb2543e45f99749cc4d61f2e8aabfe98bd905fa39951b33ea769c45ab9531c57209862ad12fd76ba4807e65417b6cd12fa8ec916f013ebb8706a96effeda06c4be24b04846392e9d1e6930eae01fa21fbd700583fb598b92c8f4eb8a61aa6235db60f2841cf3a1c6ab54c67066844711d091eb931a1bd6281aedf2a0e8fab18817202a9be06402ed9cc720c16bfe881e4df4255e87afb7fc62f38116bbe03cd8a3cb11a27d568414782f47b1a44c97c680467694bc9709d32916c97e8006cbb07ba0e4180a3738038c374c4cce8f32959afb25f303f5815c4533124acf9d18940e77522ac5dc4b9570aae8f47b7f57fd8767bea1a24ae7bed65b4afdc8f1278c30e2db98fd172730ac6bbed4f1127cd32b04a95b205526cfcb4c4e1cc955175b3e8de1f5d81b18669692350aaa1a1d797617582e54d7a5b57a683b32fb1098062dad7b0c2eb518f6862e83db25e3dbaf7aed504de932acb99d735992ce62bae9ef893ff6acc0ffcf8e3483e146b9d49dd8c7835f43a37dca0787e3ec9f6605223d5ba7ae0ab9025b73bc03f7fac36c009a56d4d95d1e81d3b3ebca7e54cc1a12d127b57c8138976e791013b015f06a624f521b6ee04ec980893c7e5e01a336203594094f82833d74427880084d35863c8e7ebb5c9eed98e72572ec40c79b26623b58022f489b0893d88be63f3f8c0d23249ebcde13db9312941c36c1d1cbcabac0c78cb3b1912db0dcbfe1893d9b51be4af1d000bac1ad0a3ae2ce1e73225fb114d05af4cefc06e875f074ffeae0cba7da3a516c173be1c513323e119f635e8209a074b216b7023fadc2d25949c90037e71e3e550726d210a2c688342e52440635e9cc14afe10102621a9c9accb782e9e4a5fa87f0a956f5b85509960285c22627c59483a5a4c28cce4b156e551406a7ee8355656a21e43e38ce129fdadb759eddfa08f00fc8e567cef93c6792d01df05e6d580f4d5d48df042451a33590d3e8cf49b2627218f0c292fa66ada945fa55bb23548e33a83a562957a3149a993cc472362298736a8b778d97ce423013d64b32cd172efa551bf7f368f04bdaec6091a3004a757598b801dcf675cb83e43a53ae8b254d333bcda20d4817d3477abfba25bb83df5949c126f149b1d99341e4e6f9120f4d41e629185002c72c012c414d2382a6d47c7b3deaba770c400ca96b2814f6b26c3ef17429f1a98c85d83db20efad48be8996fb1bff591efff360fe1199056c56e5feec61a7b8b9f699d6012c2849232f329fef95c7af370098ffe4918e0ca1df47f275867b739e0a514d3209325e217045927b479c1ce2e5d54f25488cad1513e3f44a21266cfd841633327dee6cf810fbf7393e317d9e53d1be1d5ae7839b66b943b9ed18f2c530e975422332c3439cce49a29f2a336a4851263c5e9bd13d731109e844b7f8c392a5c1dcaa2ae5f50ff63fab9765e016702c35a67cd7364d3fab552fb349e35c15c50250453fd18f7b855992632e2c76c0fbf1ef963ea80e3223de3277bc559251725829ec03f213ba8955cab2822ff21a9b0a4904d668fcd77224bde3dd01f6ffc4828f6b64230b35c6a049873494276ea1d7ed5e92cb4f90ba83a9e49601b194042f2900d99d312d7b70508cf176066d154dbe96ef9d4367e4c840e4a17b5e5122e8ebe2158a3c5f4cbae21ea3fa1ae6c25a9462ebcbb0fd5f14554bc97747c33e34da90c816d8d0d50bfe37618c5812891484fa259322c15092d4155d8696d6f12f24fd364496b3be0871ca3dd9625348a614b59bde45885649bae36de34def8fcec85343475d976ae1e9b27829ce2ac5efd0b399a8b448be6504294ee6b3c1c6a5342d7c01ae9d8ad3070c2b1a91573af5e0c5e4cbbf4acdc6b54c9272200d9970250c17c1036f06085c41858ed3a0c48150bc697e4a695fef335f7ad07e1a46dc767ff822db70e6669080b9816b2232c81a4c66cc586abfe1eaa8ca6cf41fc30eb8dc57c37a3c39c59c94232df9d388dbfa35c2cd5c75f328e9fea78f65568f2bb934c82c4142da69d12ca7de9a7df706400ec79878d868e17e8f71ea31495a8bae7bdc2e48b5118771c2fca078cca1fce0d7ef0af3478cf36f69e85a41dd29b4294a65d3e055ff718dd9dc8c75e7e5b2efe442637371b7c48f6ee99e3ea38a4b0f2f67fc2b908cda657eae754e037e262e9a9f9bd7ec4267ed8e96930e1084783c37d6f9dd15fd29f4cc477e66f130d630430dcc0104899b4f9f46eb090ef7fc90b479abf61f93955ee00e6a1848f1ab14ad334f2b68035808cdf1bb9e9d9a816baf728a955b960b7701fa626687dc3c9cba646337b53e29816e9482ddf5578a8768aae477fce410ac2d5de6095861c111d7feb3e6bb4fbb5a54955495972798350a253f05f66c2ecfcbc0ed43f5ec2e6d8dba15a51254d97b1821107c07dd9a16ef8406f943e282b95d4b362530c913d6ba421df6027de5af1e4745d5868106954be6c1962780a2941072e95131b1679df0637625042c37d48ffb152e5ebc185c8a2b7d4385f1c95af937df78dfd8757fab434968b0b57c66574468f160b447ac8221e5060676a842a1c6b7172dd3340f764070ab1fe091c5c74c95a5dc043390723a4c127da14cdde1dc2675a62340b3e6afd0522a31de26e7d1ec3a9c8a091ffdc75b7ecfdc7c12995a5e37ce3488bd29f8629d68f696492448dd526697476dc061346ebe3f677217ff9c60efce943af28dfd3f9e59692598a6047c23c4c01400f1ab5730eac0ae8d5843d5051c376240172af218d7a1ecfe65b4f75100638983c14de4974755dade8018c9b8f4543fb095961513e67c61dbc59c607f9b51f8d09bdcad28bcfb9e5d2744ea8848b2623ac07f8ef61a81a35910b8a1baf39a919a7b60bc604d63185f759221d847cc54a22765a4c33475b5791e9af3271fc8d9350667090d8184ec50522d804f23c4fb44ffa481bc92ae408d1b9f2b131904f9705c59e2f4bde7a3b2c085d93fd2abc5e14d163001a12f51938d021afa92239b873dc6c357eaa8af4ee6d00540657fe32914103b5d98f68bd3e2b5359f08ccd88d0c811e4c31fbb49f3a90bbd05dce62f344e7077593159ae35050b04c9e6b86bc432dc8b048c73c0018ca5b69411297732a4e1aa99a928c71e7a24fd277856aa42501e51b012aea9446a2104e93f815a0b3a29b458314f3d8be2b9823d342f46213e942a7e19a46e970b5c506708430317b1bb3b35df68ae33a4926a03e6bfeb5510416fcbb0524c9ca5074156cc5a5d6fe1c995edc60a2f550411aa41e3da3bdcf64bcf04a0510571b936d47e55cec0330)
|
|
= b79530fcec83211d21e3c355db538c138d625784c27370e9d1039a8515a23f87
|
|
|
|
Preimage:
|
|
0400008085202f89cacf0f5210cce5fa65a59f314292b3111d299e7d9d582753cf61e1e408552ae40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b79530fcec83211d21e3c355db538c138d625784c27370e9d1039a8515a23f87d7034302011b9a076620edc067ff020002000000090f47a068e227433f9e49d3aa09e356d8d66d0c0121e91a3c4aa3f27fa1b63396e2b41d00adedf029965102004e970568
|
|
|
|
header: 04000080
|
|
nVersionGroupId: 85202f89
|
|
hashPrevouts: cacf0f5210cce5fa65a59f314292b3111d299e7d9d582753cf61e1e408552ae4
|
|
hashSequence: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashOutputs: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashJoinSplits: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashShieldedSpends: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashShieldedOutputs: b79530fcec83211d21e3c355db538c138d625784c27370e9d1039a8515a23f87
|
|
nLockTime: d7034302
|
|
nExpiryHeight: 011b9a07
|
|
valueBalance: 6620edc067ff0200
|
|
nHashType: 02000000
|
|
|
|
Input:
|
|
prevout: 090f47a068e227433f9e49d3aa09e356d8d66d0c0121e91a3c4aa3f27fa1b633 96e2b41d
|
|
scriptCode: 00
|
|
amount: adedf02996510200
|
|
nSequence: 4e970568
|
|
|
|
sighash: bbe6d84f57c56b29b914c694baaccb891297e961de3eb46c68e3c89c47b1a1db</code></pre>
|
|
<h2 id="test-vector-3">Test vector 3</h2>
|
|
<p>Testnet transaction with txid <code>97d8814886d07fc12bbac90c089a10f90906cbb53402ee26e576ef99276c492d</code> sends only transparent funds.</p>
|
|
<p>Raw transaction:</p>
|
|
<pre><code>0400008085202f8901a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9010000006b483045022100a61e5d557568c2ddc1d9b03a7173c6ce7c996c4daecab007ac8f34bee01e6b9702204d38fdc0bcf2728a69fde78462a10fb45a9baa27873e6a5fc45fb5c76764202a01210365ffea3efa3908918a8b8627724af852fc9b86d7375b103ab0543cf418bcaa7ffeffffff02005a6202000000001976a9148132712c3ff19f3a151234616777420a6d7ef22688ac8b959800000000001976a9145453e4698f02a38abdaa521cd1ff2dee6fac187188ac29b0040048b004000000000000000000000000
|
|
|
|
header: 04000080
|
|
nVersionGroupId: 85202f89
|
|
vin: 01 a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9 01000000 6b483045022100a61e5d557568c2ddc1d9b03a7173c6ce7c996c4daecab007ac8f34bee01e6b9702204d38fdc0bcf2728a69fde78462a10fb45a9baa27873e6a5fc45fb5c76764202a01210365ffea3efa3908918a8b8627724af852fc9b86d7375b103ab0543cf418bcaa7f feffffff
|
|
vout: 02 005a620200000000 1976a9148132712c3ff19f3a151234616777420a6d7ef22688ac
|
|
8b95980000000000 1976a9145453e4698f02a38abdaa521cd1ff2dee6fac187188ac
|
|
nLockTime: 29b00400
|
|
nExpiryHeight: 48b00400
|
|
valueBalance: 0000000000000000
|
|
vShieldedSpend: 00
|
|
vShieldedOutput: 00
|
|
vJoinSplit: 00</code></pre>
|
|
<p>Transaction digest with <code>nIn = 0</code> and <code>nHashType = 1</code> (<code>SIGHASH_ALL</code>):</p>
|
|
<pre><code>Preimage:
|
|
0400008085202f89fae31b8dec7b0b77e2c8d6b6eb0e7e4e55abc6574c26dd44464d9408a8e33f116c80d37f12d89b6f17ff198723e7db1247c4811d1a695d74d930f99e98418790d2b04118469b7810a0d1cc59568320aad25a84f407ecac40b4f605a4e686845400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000029b0040048b00400000000000000000001000000a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9010000001976a914507173527b4c3318a2aecd793bf1cfed705950cf88ac80f0fa0200000000feffffff
|
|
|
|
header: 04000080
|
|
nVersionGroupId: 85202f89
|
|
hashPrevouts: fae31b8dec7b0b77e2c8d6b6eb0e7e4e55abc6574c26dd44464d9408a8e33f11
|
|
hashSequence: 6c80d37f12d89b6f17ff198723e7db1247c4811d1a695d74d930f99e98418790
|
|
hashOutputs: d2b04118469b7810a0d1cc59568320aad25a84f407ecac40b4f605a4e6868454
|
|
hashJoinSplits: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashShieldedSpends: 0000000000000000000000000000000000000000000000000000000000000000
|
|
hashShieldedOutputs: 0000000000000000000000000000000000000000000000000000000000000000
|
|
nLockTime: 29b00400
|
|
nExpiryHeight: 48b00400
|
|
valueBalance: 0000000000000000
|
|
nHashType: 01000000
|
|
|
|
Input:
|
|
prevout: a8c685478265f4c14dada651969c45a65e1aeb8cd6791f2f5bb6a1d9952104d9 01000000
|
|
scriptCode: 1976a914507173527b4c3318a2aecd793bf1cfed705950cf88ac
|
|
amount: 80f0fa0200000000
|
|
nSequence: feffffff
|
|
|
|
sighash: f3148f80dfab5e573d5edfe7a850f5fd39234f80b5429d3a57edcc11e34c585b</code></pre>
|
|
<h1 id="deployment">Deployment</h1>
|
|
<p>This proposal is deployed with the Sapling network upgrade.<a href="#fn14" class="footnote-ref" id="fnref14"><sup>14</sup></a></p>
|
|
<h1 id="backward-compatibility">Backward compatibility</h1>
|
|
<p>This proposal is backwards-compatible with old UTXOs. It is <strong>not</strong> backwards-compatible with older software. All transactions will be required to use this transaction digest algorithm for signatures, and so transactions created by older software will be rejected by the network.</p>
|
|
<h1 id="reference-implementation">Reference Implementation</h1>
|
|
<p><a href="https://github.com/zcash/zcash/pull/3233" class="uri">https://github.com/zcash/zcash/pull/3233</a></p>
|
|
<h1 id="references">References</h1>
|
|
<section class="footnotes">
|
|
<hr />
|
|
<ol>
|
|
<li id="fn1"><p><a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a><a href="#fnref1" class="footnote-back">↩</a></p></li>
|
|
<li id="fn2"><p><a href="https://github.com/zcash/zips/blob/master/zip-0200.rst">ZIP 200: Network Upgrade Mechanism</a><a href="#fnref2" class="footnote-back">↩</a></p></li>
|
|
<li id="fn3"><p><a href="https://github.com/zcash/zips/blob/master/zip-0205.rst">ZIP 205: Deployment of the Sapling Network Upgrade</a><a href="#fnref3" class="footnote-back">↩</a></p></li>
|
|
<li id="fn4"><p><a href="https://github.com/zcash/zips/blob/master/zip-0143.rst">ZIP 143: Transaction Signature Verification for Overwinter</a><a href="#fnref4" class="footnote-back">↩</a></p></li>
|
|
<li id="fn5"><p><a href="https://github.com/zcash/zips/blob/master/protocol/protocol.pdf">Zcash Protocol Specification, Version 2018.0-beta-37 [Overwinter+Sapling]</a><a href="#fnref5" class="footnote-back">↩</a></p></li>
|
|
<li id="fn6"><p><a href="https://github.com/zcash/zips/blob/master/zip-0205.rst">ZIP 205: Deployment of the Sapling Network Upgrade</a><a href="#fnref6" class="footnote-back">↩</a></p></li>
|
|
<li id="fn7"><p><a href="https://blake2.net/blake2.pdf">"BLAKE2: simpler, smaller, fast as MD5", Section 2.8</a><a href="#fnref7" class="footnote-back">↩</a></p></li>
|
|
<li id="fn8"><p><a href="https://github.com/zcash/zips/blob/master/zip-0200.rst">ZIP 200: Network Upgrade Mechanism</a><a href="#fnref8" class="footnote-back">↩</a></p></li>
|
|
<li id="fn9"><p><a href="https://github.com/zcash/zips/blob/master/zip-0143.rst">ZIP 143: Transaction Signature Verification for Overwinter</a><a href="#fnref9" class="footnote-back">↩</a></p></li>
|
|
<li id="fn10"><p><a href="https://github.com/zcash/zips/blob/master/zip-0143.rst">ZIP 143: Transaction Signature Verification for Overwinter</a><a href="#fnref10" class="footnote-back">↩</a></p></li>
|
|
<li id="fn11"><p><a href="https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/zip_0243.py">ZIP 243 Test Vectors</a><a href="#fnref11" class="footnote-back">↩</a></p></li>
|
|
<li id="fn12"><p><a href="https://github.com/zcash/zcash/blob/master/src/test/data/sighash.json">SignatureHash Test Vectors</a><a href="#fnref12" class="footnote-back">↩</a></p></li>
|
|
<li id="fn13"><p><a href="https://github.com/zcash/zcash/blob/master/src/test/data/sighash.json">SignatureHash Test Vectors</a><a href="#fnref13" class="footnote-back">↩</a></p></li>
|
|
<li id="fn14"><p><a href="https://github.com/zcash/zips/blob/master/zip-0205.rst">ZIP 205: Deployment of the Sapling Network Upgrade</a><a href="#fnref14" class="footnote-back">↩</a></p></li>
|
|
</ol>
|
|
</section>
|
|
</body>
|
|
</html>
|