Skip to content

Commit d81a945

Browse files
committed
pass over the overview
1 parent 7a482c7 commit d81a945

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

docs/new-docs/03-transaction.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Transaction Overview
22

3+
On this page we overview different pieces of data that are involved in a
4+
transaction, and the invariant conditions on that data that the transactions
5+
maintain.
6+
37
As mentioned in [Overview](overview), ZeroPool encodes all possible actions a
48
user may want to perform on the pool with a single transaction type. A ZeroPool
59
transaction consumes one account (associated with user's spending key $\sigma$)
@@ -9,9 +13,6 @@ old one) and `OUTPUT` number of new notes. The created new notes may belong to
913
accounts of other users (with keys different from $\sigma$). Consumed account
1014
and notes can not be used again.
1115

12-
There may exist no more than one account associated with a given spending key
13-
$\sigma$ at any single moment.
14-
1516
:::tip
1617

1718
Since the consumed and newly created account have the same associated
@@ -169,18 +170,21 @@ meaning in ZeroPool.
169170

170171
### Nullifiers
171172

172-
Nullifiers are special values that are unique for each pair of account + its
173-
corresponding intermediate key $\eta$, which don't reveal the data of that
174-
account and key. In practice, it's simply the hash of the account (all the
175-
fields in its structure), accounts index in the sequence, and the intermediate
176-
key $\eta$ that the transaction is being invoked with,
173+
Nullifiers are special hash values that are computed based on account's data
174+
and its corresponding intermediate key $\eta$. An account's nullifier uniquely
175+
identifies the account — yet it doesn't reveal the data of that account or its
176+
key.
177+
178+
More concretely, an account's nullifier is a hash of the account structure (all
179+
the fields in it), account's index in the sequence, and the intermediate key
180+
$\eta$ that the transaction is being invoked with,
177181

178182
$$
179183
\textsf{nullifier} = H(\textsf{account}, \textsf{index}, \eta).
180184
$$
181185

182-
For each transaction, the user publishes the nullifier of the account that
183-
serves as input to this transaction. The ZeroPool smart-contract keeps the
186+
When submitting a transaction, the user publishes the nullifier of the account
187+
that serves as input to this transaction. The ZeroPool smart-contract keeps the
184188
global history of all nullifiers it had seen, and rejects the transaction if
185189
its corresponding nullifier was already recorded. This way, we make sure that
186190
no account can serve as input to a transaction more than once.
@@ -224,8 +228,8 @@ incrementally append values to it.
224228

225229
Consider a Merkle Tree of height $h$. To store the sequence $s_0, s_1 \dots
226230
s_{n-1}$ of accounts and notes in it, we assign first (going from left to
227-
right) $n$ leaves of the tree hashes $H(s_0), H(s_1) \dots H(s_{n-1})$ and fill
228-
the remaining $2^h - n$ leaves with zeroes. And we compute the values of all
231+
right) $n$ leaves of the tree hashes $H(s_0), H(s_1) \dots H(s_{n-1})$ and
232+
fill the remaining $2^h - n$ leaves with zeroes. We compute the values of all
229233
inner nodes according to the usual Merkle Tree rule. (If no transactions have
230234
happened yet and the sequence is empty, all leaves of the Merkle Tree will be
231235
initialized with zeroes.)
@@ -237,17 +241,17 @@ $k$ into $h$ bits and treat $0$s and $1$s in it as a sequence of "left" and
237241
recompute the Merkle Tree if some leaf is modified, or even multiple leaves in
238242
bulk by updating a subtree. We've covered this in [Background](background).
239243

240-
Even though Merkle Tree allows modifying any leaf, including the ones we've
241-
assigned before, we only use this functionality to append values to the
244+
Even though Merkle Tree allows modifying any leaf (including the ones we've
245+
assigned before), we only use this functionality to append values to the
242246
sequence and never modify elements that were added to it before. Say, if the
243247
Merkle Tree leaves currently currently have values
244248

245249
$$
246250
H(s_0), H(s_1) \dots H(s_{n-1}), 0, 0 \dots 0
247251
$$
248252

249-
assigned to them, the only modification we will do is assigning value
250-
$H(s_{n})$ to leaf $n$.
253+
assigned to them, the only modification we will do is overwriting the $0$ in
254+
leaf $n$ with value $H(s_{n})$.
251255

252256
Using Merkle Tree commitment to implement a sequence of accounts and notes in
253257
ZeroPool means that the total length of the sequence can never exceed $2^h$.

0 commit comments

Comments
 (0)