diff --git a/README.md b/README.md index 206901f..6c450bc 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,12 @@ Block { ## Protocol Design -The system is a toy protocol and it is only very partially implemented. The following explains the current implementation and the cryptographic operations involved. +The system is a toy protocol and it is only very partially implemented. + +The key cryptographic primitives used by the protocol are the following: +* ECDSA secp256k1 for signatures of both transactions and blocks; +* Keccak256 for all hashing purposes including ECDSA, content-addressable IDs (transaction and block hashes), as well as construction of Addresses (last 20 bytes of the hash); and +* Incremental Merkle trees for withdrawal transactions which allows for L2->L1 transfers via Merkle proofs. ### Sequencing diff --git a/rollup/src/address.rs b/rollup/src/address.rs index 26f1c8c..0bfc014 100644 --- a/rollup/src/address.rs +++ b/rollup/src/address.rs @@ -9,6 +9,7 @@ pub struct Address(AlloyAddress); impl From for Address { fn from(pk: PublicKey) -> Self { + // The last 20 bytes of the public key's keccak256 hash is the address. let digest = keccak256(&pk.serialize_uncompressed()[1..]); Address(AlloyAddress::from_slice(&digest[12..])) }