privacy-scaling-explorations / zkevm-specs

333 stars 272 forks source link

Transaction signature verification #65

Open han0110 opened 2 years ago

han0110 commented 2 years ago

In Tx circuit, we need to verify each transaction has valid signature.

The following should be described as part of specs/circuits/tx.md:

ed255 commented 2 years ago

An initial version of the tx circuit is now specified at https://github.com/appliedzkp/zkevm-specs/blob/master/specs/transactions-proof.md

* How it RLP encodes transaction and verify hash is correct using circuit `keccak256` by lookup

For the first iteration we have made a shortcut to simplify the design in which we skip the RLP encoding of the transaction and the hashing of the RLP encoded transaction. Instead we ask the verifier to calculate the hash of the transaction and pass it to the circuit via the tx table.

Future iteration TODO:

* How it recovers address from signature

For the first iteration we integrate an ECDSA verification chip in the tx circuit. The address recovery is done by the prover, and the circuit verifies that the address corresponds to a public key for which the signature and hash verify.

Future iteration TODO: