Web3 Industry Report

icon picker
以太坊学习

Loading…

Web3 has some limitations right now:
Scalability – transactions are slower on web3 because they're decentralized. Changes to state, like a payment, need to be processed by a node and propagated throughout the network.
UX – interacting with web3 applications can require extra steps, software, and education. This can be a hurdle to adoption.
Accessibility – the lack of integration in modern web browsers makes web3 less accessible to most users.
Cost – most successful dapps put very small portions of their code on the blockchain as it's expensive
Ethereum Account type:
Externally Owned Account
Creating an account costs nothing
Can initiate transactions
Transactions between externally-owned accounts can only be ETH/token transfers
Made up of a cryptographic pair of keys: public and private keys that control account activities
Contract Owned Account
Creating a contract has a cost because you're using network storage
Can only send transactions in response to receiving a transaction
Transactions from an external account to a contract account can trigger code which can execute many different actions, such as transferring tokens or even creating a new contract
Contract accounts don't have private keys. Instead, they are controlled by the logic of the smart contract code

Mastering Ethereum

Ethereum Spec, Client, node
image.png

Trapdoor function:
RSA - Prime Number Factorization

amount of bits required by ECC vs RSA to achieve same security level
256 bits vs 3072 bits
(Top Secret) 384 bits vs 7680 bits
Keccak256("") =
c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470

SHA3("") =
a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a
Ethereum uses Keccak-256, even though it is often called SHA-3 in the code


Wallets

wallet refers to the system used to store and manage a user’s key [programmer’s perspective]
common misconception: wallet does not hold ether or tokens; wallet is simply a keychain

Wallet Technology Overview

nondeterministic wallet aka. Just a Bunch of Keys wallet - each key is independently generated from a different random number.
deterministic wallet - all the keys are derived from a single master key
mnemonic seed - the seeds are often encoded as a list of words
Hierarchical Deterministic Wallets (BIP-32/BIP-44)
Wallet Best Practices
Mnemonic code words, based on BIP-39
HD wallets, based on BIP-32
Multipurpose HD wallet structure, based on BIP-43
Multicurrency and multiaccount wallets, based on BIP-44
image.png
image.png

The Ethereum Contract ABI
in ethereum, the ABI is used to encode contract calls for the EVM and to read data out of transactions
the purpose of an ABI is to define the functions in the contract that can be invoked and describe how each function will accept arguments and returns its results
an contract’s ABI is specified as a JSON array of function descriptions & events
function description JSON Object
type, name, inputs, outputs, constant, payable
image.png
event description JSON Object
type, name, inputs, anonymous
All that is needed for an application to interact with a contract is an ABI and the address where the contract has been deployed.

Ether.js Modules
Ethers.Provider: This module enables you to establish a connection with the Ethereum blockchain. You use it to issue queries and send signed transactions. Through this module, Ethers.js users get to change the state of the blockchain.
Ethers.Contract: You use this module to deploy and interact with smart contracts. While deploying smart contracts is one of the main purposes of Ethers.Contract, it has more to offer. As such, it also packs functions that enable developers to ‘listen’ to smart contract events (). Furthermore, you also use this module to get information about smart contracts and call particular functions provided by smart contracts.
Ethers.Utils: You will use this module when you want to format data and process user inputs. As such, Ethers.utils makes building dApps a whole lot easier.
Ethers.Wallet: As you can assume based on the ‘.wallet’, Ethers.Wallet provides a way to connect to any existing Ethereum address (an Ethereum wallet). On top of that important feature, this module also enables you to create new wallets and sign transactions
Web3.js Modules
Web3.eth: The Eth module is there for interacting with the Ethereum network. It offers several sub-modules, including Web3.eth.subscribe, Web3.eth.contract, Web3.eth.accounts, Web3.eth.personal, and more.
Web3.*.net: The Net module is there for interacting with network properties. Of course, it may be used as a sub-module to interact with Ethereum (Web3.eth.net).
Web3.bzz: The Bzz module is there for interacting with the swarm network.
Web3.shh: The Shh module is there for interacting with the whisper protocol.
Web3.utils: This module provides utility functions for Ethereum dApps and other web3.js packages.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.