iden3/rollup

pay to public key instead of pay to merkle tree index

Opened this issue · 2 comments

There are two types of transaction that we could support

  1. Where we create an transactions that will send funds to merkle tree index where we define the index in the merkle tree and send the funds there.
  2. Where we create a transaction that will send funds to a public key.

I would prefer to do 2 as it makes for nice UX when we create accounts.

For example If i don't have an account in rollup I can ask someone to send me some funds to a public key that is not in the tree.

This tx can have a high fee that would incentivize the operator to create an account for me so that they can claim the high fee. This fee can be high enough to reimburse them for the gas fee to create the account.

Another example of where this is painful is when I want to trade token A for token B.

If I don't hold token B i will need to create a new account for B by going on chain.

If we enable pay to public key I will be pay a marginally higher fee and have the account created for me without having to go on chain.

I think having normal users never needing to pay for gas or worry about it is very nice UX.

I think it's a good idea that what you are signing is the destination public key instead of the index.
In the data availability you continue to put the index.
In the circuit it must much the index and the bublic key.....