Transactions Flow: 트랜잭션 생성 및 서명 → 서명 검증
storage: persistent data store(state variables)
storage layout: (key: $2^{256}$ slot, value: 한 slot당 32 bytes이하.)
keccak(slotID): {
{ key: slotID, value: data length },
{ key: hashed slotID, value: data },
{ key: hashed slotID, value: data }
}
contract StorageExample {
uint256 public x; // Slot 0
uint256[] public dynamicArray; // Slot 1 (length stored here, elements at keccak256(1))
mapping(uint256 => uint256) public map; // Hash-based storage
struct MyStruct {
uint128 a;
uint128 b;
uint256 c;
}
MyStruct public s; // Starts at Slot 2
}
memory: temporary data store(function parameters, local variables)
stack: opcode operation
calldata: read-only data
Log
Signing
Input: Random Integer, Hashed message, private key
Output: Signature (R, S)
Verifying
Input: Signature (R, S), Hashed message, public key
Output: Valid or Invalid
Elliptic Curve Cryptography(ECC) Public key
ECC -> prefix 04(uncompressed) => 65 bytes
-> prefix 02(compressed): y is even. => 33 bytes
-> prefix 03(same as above): y is odd.
why compress?
two times less space in memory by removing the y coordinate
Kademlia: Node discovery
RLP(Recursive Length Prefix), Serialization, RLPx: Data Exchange Protocol
이더리움 네트워크에서 노드에 데이터 저장 or 통신에 통일된 형식이 필요, Data format.
Problem: eliminating or cleaning obsolete historical data to optimize disk space.
How it works
Iterating state snapshot
Pruning state data: from the database
Compacting database