transactions proof会:
transactionsRoot对应的merkle patricia trie中刚好包含了所有的交易(不多不少);存在不同的交易编码方式。在第一版本的zkEVM将仅支持兼容EIP-155的Legacy transaction。未来将支持Non-Legacy (EIP-2718)transactions。
Legacy type为:
rlp([nonce, gasPrice, gas, to, value, data, sig_v, r, s])
(nonce, gasprice, gas, to, value, data) with sig_v = {0,1} + 27(nonce, gasprice, gas, to, value, data, chain_id, 0, 0) with sig_v = {0,1} + CHAIN_ID * 2 + 35其中的{0,1}表示的curve point
y
y
y坐标的极性,该curve point对应为secp256k1签名过程中的公钥。
根据:
Non-Legacy类型为:
0x02 || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s])
待签名的hashed data为:待定。
Transactions proof证明电路中对应的public inputs有:
每笔交易由以下参数定义:
其中可用作public inputs的参数有:
Transactions proof证明电路的验证逻辑为:
其中:
根据以上信息,构建了TxTable:
| 0 TxID | 1 Tag | 2 Index | 3 value |
|---|---|---|---|
| TxContextFieldTag | |||
| $TxID | Nonce | 0 | $value: raw |
| $TxID | Gas | 0 | $value: raw |
| $TxID | GasPrice | 0 | $value: rlc |
| $TxID | GasTipCap | 0 | $value: 0 |
| $TxID | GasFeeCap | 0 | $value: 0 |
| $TxID | CallerAddress | 0 | $value: raw |
| $TxID | CalleeAddress | 0 | $value: raw |
| $TxID | IsCreate | 0 | $value: raw |
| $TxID | Value | 0 | $value: rlc |
| $TxID | CallDataLength | 0 | $value: raw |
| $TxID | CallData | $ByteIndex | $value: raw |
其中:
1 if to is None else 0