Bxpana
@bxpana
This Week I Learned (TWIL): Signature Standards in Ethereum and Diamond Proxies Letโs dive into two critical EIPs: EIP-191 and EIP-712. They play a key role in making Ethereum signatures more secure, readable, and versatile. ๐
1 reply
0 recast
4 reactions
Bxpana
@bxpana
Why do we need these standards? โ Human-readable messages: EIP-712 shows structured, user-friendly signing prompts. โ Security: EIP-712 prevents replay attacks. โ Sponsored transactions: EIP-191 enables sending transactions on behalf of users.
1 reply
0 recast
1 reaction
Bxpana
@bxpana
EIP-191: Basic Structure ๐ Format: 0x19<1 byte version><version specific data><data to sign> Examples of <1 byte version>: ๐น 0x00: Data with a validator ๐น 0x01: Structured data (EIP-712-compatible) ๐น 0x45: Personal_sign
1 reply
0 recast
2 reactions
Bxpana
@bxpana
EIP-712: Structured Data Signing EIP-712 improves traditional message signing by: ๐ผ๏ธ Adding structure for easier message readability. ๐ก๏ธ Defining fields explicitly to prevent signing unintended data. Letโs break it down! ๐
1 reply
0 recast
2 reactions
Bxpana
@bxpana
Key Components of EIP-712 1๏ธโฃ Domain Separator: It encodes metadata like app name, version, chain ID, and contract address. It ensures the signature is valid only within its intended domain.
1 reply
0 recast
2 reactions
Bxpana
@bxpana
2๏ธโฃ Hashing the Message: EIP-712 hashes the structured message to ensure integrity and prevent tampering.
1 reply
0 recast
0 reaction
Bxpana
@bxpana
Finally, combine everything: The signature includes: 0x19 0x01 <domainSeparator> <hashStruct(message)> This ensures: ๐ Security ๐ Transparency for users EIP-712 = Better UX + Stronger Security ๐
1 reply
0 recast
0 reaction
Bxpana
@bxpana
Diamond Proxy Architecture Another gem from this week: Diamonds! ๐ They enable modular, upgradeable contracts via EIP-2535. Think of it as: ๐จ A hotel where: โข Front desk = Diamond proxy โข Services = Facets โข Shared resources = Shared storage
1 reply
0 recast
0 reaction