Open lispc opened 3 years ago
we may use poseidon / fields rather than sha3/bits first. This will make development/test easier. Once the design is finalized, we can switch to sha3/bits_encoding.
we can handle L1(withdraw&deposit) tx data and L2(trading&transfer) tx data differently. eg, only put L1 tx data onchain, or limit L1 tx num in each l2 block
(only transfer now)
Step1 without amount encoding. circuits add 1 public input block: hash(data)
Step2 (optional) with amount encoding
step 3: check availalibity: check reconstructing data can get correct merkle root (rust)
more: well-designed integer encoding / a DA tree + a non-DA tree / spottrade and other txs
As reference, in hermez they has hashed:
For each tx: from / to / amount / tokenID / nonce / fee:
Compare to our current circuit:
And we can still post the compressed data (raw data being hashed) in rollup tx?
2. For different type of tx, variant length for (encoded) tx being used in hasher would be essential, padding to longest tx (spot) should be unacceptable. (not work, the length of encoding bits must fixed)
The meaning of 'data availability' is to enable proving
account
hasbalance
oftoken
in the tree.So order details are not needed.SpotTrade:
So total 42 bytes.
DepositToOld:
DepositToNew
total: 61bytes
Transfer
Withdraw