Skip to main content

Mastering Ethereum Part II

Digital signature prove knowledge of a secret without revealing it.
Account address are derived directly from private keys.
Public key cryptography also known as asymmetric cryptography.
Public key can be derived from private keys.

A digital signature is code that is produced with private key and the transaction details (the message).
A private key is a number between 1 and 2^256

The public key is on a point on an elliptic curve, with an X and Y value.
PubK = PrivKey * G a constant generator point

Ethereum cryptographic Hash function: Keccak-256 (not the finalized SHA-3 different output)
Addresses are hex numbers dervied from the last 20 bytes of the public key.
Inter exchange client address protocol (ICAP) checksum prevent wrongly input address.

Wallet: serves as the primary user interface for the user to access money, managing keys, address, creating and signing transaction. But at it's core it's a data structure that acts as a container to store the private key.

Wallets does not contain tokens are ether only the power to move them, and see their balance.
Mnemonic words are predefined each words represent 11-bits of data which is 4 bits of SHA256 of the private key input with generated entropy you end up with a 512-bit seed which is your seed

Transactions are signed messages originated by an externally owned account, to change the global singleton state.

v,r,s use to derived the sender of the transaction EOA or account.
Nonce is use to help calculate the order of transaction being sent by an account.
Ethereum is not UTXO

Ethereum allows distributed operations but enforces a singleton state through consensus.
Gas is separate from ether in order to protect the system from volatility of price movements.

A transaction contains two fields value and data. If destination address is a contract the EVM will execute the contract and attempt to call the function named (Contract invocation). Account won't accept data transaction.

Contract creation is a special transaction to a special destination 0x0.

A digital signature is  a mathematic scheme for presenting the authenticity of digital message or documents.

Sig = F sig(F keccak256(m), PrivKey)
Signature =  signing algo(hashed(transaction message), private key)
Signature algo generate temp private key use for calculation of (r,s)

Sig = (r,s) the transaction msg, public key
Chain ID (enable replay attack protection)

Ethereum uses a "flood routing" a form of mesh network


Comments

Popular posts from this blog

Mastering Ethereum Part I

Account contains: -Address (rightmost 160 bits of Keccak(SHA-3) hash of public key) -Balance -Nonce -Storage and code Assert(false) compiles to 0xfe, uses up all gas and reverts all changes Big-endian: most significant digits first Little-endian: least significant digits first BIPS: bitcoin improvement proposals Byte code: numeric format virtual machine executable Contract account: An account containing code that executes when receiving a transaction from another account. Contract creation transaction: Special transaction with "zero address" as recipient that register a contact and recode it on the Ethereum blockchain Digital signature: Using a private key which the user produces a short string that can prove with the corresponding public key plus the signature(short string) combine to verify that document(transaction) was created by the user who owns the private key. Gas: The computational cost of an execution on a smart contract. Turing Complete: Gener...

Designing Data-Intensive Applications I

The main goals of designing a data-Intensive applications: 1. Reliability: Tolerating hardware and software faults, human error 2. Scalability: Measuring load & performance, latency percentiles, throughput 3. Maintainability: Operability, simplicity and evolvability Databases: storing data Caches: remembering expensive operation Search Indexes: allow users to search data by keywords Stream processing: send message from one process to another Batch processing: periodically crunch a large amount of accumulated data Redis: datastore used as message queses Kafka: message queues with database-like durability guarantees Systems that anticipate faults and cope with them are called fault-tolerant or resilient. 1. Design systems in a way that minimizes opportunities for error. 2. Decouple the places where people make the most mistakes. 3. Test thoroughly from unit tests to whole-system integration tests. 4. Minimize impact in the case of failure 5. Setup monitoring refe...