Skip to content

Commit

Permalink
Add more detail to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sergerad committed Aug 30, 2024
1 parent 1ababf3 commit f629900
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions rollup/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct Address(AlloyAddress);

impl From<PublicKey> 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..]))
}
Expand Down

0 comments on commit f629900

Please sign in to comment.