Replies: 4 comments 6 replies
-
This is very helpful. One small note - it seems like you're now referring to the prefix that a user registers with the operator as their "tag", but the terminology isn't used consistently, so I wanted to clarify (or be corrected).
This registered prefix is Bob's tag, as described here, right?
A final bit of clarification (and perhaps this would be better in #7) - in the off-chain interaction case, the operator doesn't necessarily know the length of the tag part of the note's serial number, and should therefore notify for any matching serial number of any length, right? For example, Bob's tag could in theory have been 10 bits instead of 14 (according to my understanding of #7), so Alice could have used a serial number of |
Beta Was this translation helpful? Give feedback.
-
As always, this is super clearly described. So I tried to put what I have digested into a diagram: So in the case of A, there is no problem to be solved in the initial phase, right? Bob can check all incoming notes and then execute them against the correct ones. If we only would have 2 TPS in the first year, Bob should be able to sync with RPC provider, or he could ask the sequencer if there is a note for Bob. In cases B and C, we need a protocol for Bob to know that there is a note and to be able to receive his asset. For B I understand the protocol that you have outlined. The question to me is, do we want to provide such a channel? In theory, this could be any off-chain communication channel, even WhatsApp or email. And in that case, what would a 3rd party know if either Alice or Bob stores the account data on-chain with the sequencer? I assume 3rd parties would only see that the account vault increases or decreases after a note with a certain hash are executed. Is that correct? For C I understand the problem and the solution that you propose. I do have some clarification questions here:
If Alice is executing the transaction locally against her account, why is the account being updated in 4a) and not yet in step 3)? Especially when we assume that the operator only stores the account hashes. (Maybe that also points to different layers of finality).
There might be a subcase where the transaction can stay partially private (or correct me if I am wrong). If Bob knows that Alice sends something to him in a certain time window, couldn't Bob observe all new notes and still grind? Especially when he somehow would know the asset or the amount (because he only accepts 10 USDC, and Alices knows that). Maybe in the beginning that might be sufficient as a protocol (in case it is too hard to find a suitable one?).
I don't understand why "[A]anyone observing the chain will know all the details about the transaction." If Alice or Bob only stores their Account data off-chain, then the operator only knows the account hash. So any observer would only see that Alice's hash changed, and then at a later point in time, Bob's account hash changes. I am sure I am missing something, but can you elaborate? On a more general note:
We could also add those four privacy modes step-by-step - whatever is easiest for the MVP:
|
Beta Was this translation helpful? Give feedback.
-
Question: the examples above say that execution of the transaction could be done by the network. One case was for Alice when she sent some asset to Bob. The document said:
My question is, what data would Alice have sent to the network to allow the transaction execution? I assume it is some sort of signature, but I haven't seen a scheme for that yet. |
Beta Was this translation helpful? Give feedback.
-
Hi - for 2a (only account hashes stored on chain), want to ensure I understand, double spends (erroneous state transitions) are prevented b/c the MidenVM must be used to create the transaction to be proved. so if Alice and Bob agree on the script, then its not possible to create a valid proof of incorrect state transition? the trust anchor becomes the VM in this case since the account hash must accompany every transaction (so alice can't use multiple account hashes to perform a double spend). |
Beta Was this translation helpful? Give feedback.
-
In this note I'd like to outline how users could transfer assets between each other on Polygon Miden. This is probably one of the simplest use cases, but even here, there are a few nuances which are important. Also, this is just an illustrative example, many choices of concrete values could end up being different in the actual system.
As described in #7 (comment), there are two basic scenarios for user-to-user transactions, and we'll cover both them. The scenarios are:
Before diving into interaction flows, let's lay out some basic assumptions and terminology.
Assumptions
send_asset
andreceive_asset
functions.send_asset
function creates a note which can be claimed by the specified recipient.receive_asset
adds the specified asset to an account's vault.The above script assumes that note inputs are arranged as follows:
We'll refer to this script as
P2IDR
(pay to account ID with recall).No off-chain interaction
Let's say Alice wants to send some asset
X
to Bob, but Bob is not online (or Alice doesn't know how to contact Bob). All Alice has is a QR code from Bob. The transfer of assetX
could be accomplished as follows.Alice creates a note for Bob
a. Bob's tag (14 bits).
b. Bob's account ID (168 bits).
send_asset
function on her account and creates a new note. This note will look as follows:a. Note script represented by the MAST root of
P2IDR
.b. Script inputs set to some future block height, Bob's account ID, and Alice's account ID.
c. Vault with a single asset
X
.d. A serial number which Alice will pick in such a way that the first 2 bits of the note's hash are set to
10
and the following 14 bits are set to Bob's tag. To find such a serial number, Alice would need to performa. Alice's account is updated to remove asset
X
from the account's vault.b. A new note with asset
X
is added to the note's database. Because the first two bits of the note's hash are10
, the operator will also record the full note details on chain.Note that step 3 could have been different. Alice could have sent the transaction to the network, in which case the operator would have executed and generated a transaction proof. But this change would not have any effect on step 4.
Bob consumes the note created by Alice
a. I will skip the detail of how this notification happens. The options could range from push notifications to Bob making an RPC call to retrieve all notes with a given prefix.
a. To check this, Bob will look at the note's script and realize that this is a
P2IDR
script. Then, Bob will check the second input field to see if the ID matches his own account ID. Both of these checks should be very light-weight.a. The note created by Alice is consumed.
b. Bob's account is updated to add asset
X
to its vault.Note that step 4 could have been different. Bob could have sent the transaction to the network, in which case the operator would have executed and generated a transaction proof. But this change would not have any effect on step 5.
Privacy guarantees
This transaction flow is not private. Anyone observing the chain will know all the details about the transaction. Specifically:
X
was removed from Alice's account.X
was added to Bob's account.With off-chain interaction
Let's now say that there is a separate channel between Alice and Bob. The interaction flow could look as follows.
Alice creates a note for Bob
a. That asset
X
is being transferred.b. That
P2IDR
script will be used.c. What serial number to use. The serial number will be chosen in such a way that the hash of the note starts with
00
and is followed by Bob's 14-bit tag. Either Alice or Bob could compute the serial number, but both must know the serial number at the end.send_asset
function on her account and creates the agreed upon note.a. Alice's account is updated to remove asset
X
from the account's vault.b. A new note with asset
X
is added to the note's database. Because the first two bits of the note's hash are00
, only the hash of the new note is recorded on-chain.Note that in step 3, Alice didn't have to execute the transaction locally. Instead, she could have sent the transaction to the operator. In this case, the operator would know the details of the transaction, but these details would not be recorded on chain.
Bob consumes the note created by Alice
a. The note created by Alice is consumed.
b. Bob's account is updated to add asset
X
to its vault.Note that in step 4, Bob didn't have to execute the transaction locally. Instead, he could have sent the transaction to the operator. In this case, the operator would know the details of the transaction, but these details would not be recorded on chain.
Privacy guarantees
Depending on how the transaction is executed and how Alice's and Bob's accounts are recorded on chain, we get different privacy guarantees:
First, let's assume Alice and Bob record only hashes of their accounts on-chain and maintain full account states locally. In this case:
Next, let's assume Alice and Bob record full states of their accounts on chain. In this case, observers may be able to determine the details of the transaction as they will see that asset
X
was removed from Alice's account and added to Bob's account. And the more uniqueX
is the easier it will to determine what happened.It is worth noting that in either case both Alice and Bob know who the counter-party in the transaction is. If this is undesirable, additional measures can be taken to hide the sender from the recipient and/or the recipient from the sender - but some compromises may need to be made. For example, if we want to hide the recipient (i.e., Alice wouldn't learn which account consumed the note), then we can't use a recallable note. This is because for a note to be recallable Alice must know its serial number. But knowing of the serial number implies that Alice will be able to compute the note's nullifier and, thus, will know which transaction consumed a note.
Beta Was this translation helpful? Give feedback.
All reactions