banner
leaf

leaf

It is better to manage the army than to manage the people. And the enemy.

Skills Summary

image

Pre-knowledge of blockchain, including the origin of blockchain, wallet addresses, Bitcoin, Ethereum, and other basic concepts; then understand the similarities and differences between DAPP project development and traditional project development; finally, introduce some basic development tools, such as remix, rpc, etc., to lay a solid foundation for formal learning.

Differences between App and Dapp Architecture

After more than 20 years of Internet development, various architectures have become very mature, and with the rise of mobile, the architecture of Apps has not changed much;

But compared to the architecture of Dapps, everything is completely different. It is more of a change in mindset than a technological revolution.

In addition, if you observe carefully, you will find that mainstream dapps generally do not call themselves apps, but rather "protocols", such as aave and compound, which call themselves lending protocols. The reason is that apps are closed, while protocols can be integrated and expanded.
App Architecture

The B/S or C/S architecture is roughly like this, from the front end to the back end, from the server room to the cloud native, technology is iterating, and efficiency is improving, everything is becoming smoother. The underlying systems are roughly divided into: Unix, Linux, Dos, MacOs, Windows, Android, IOS, etc.

image

The architecture of decentralized applications is completely different from that of Apps because there is no dedicated backend. Its blockchain network is the underlying system, such as the Ethereum network, BSC network, etc.

The architecture of the simplest Dapp application can be described as follows, we call it: V1 version architecture

image

V1: As we can see, at this time the browser has an additional wallet module. The wallet is the key to open the blockchain. The whole world on the blockchain is built on cryptography (asymmetric encryption, if you don't understand, it doesn't matter). The blue part in the picture is the blockchain network, and our program runs in it. It is both a backend service and a database. Our frontend interacts directly with the blockchain network, including:

Read data (read blockchain ledger data), free
Write data (submit data to the blockchain network for permanent storage, at this time, miners need to package and execute it), paid (remember this, it will be explained gradually in the subsequent language learning)

V2: With the development of the blockchain network ecosystem, people have gradually discovered optimization space. That is, we can pre-store read operations in a server, and then the frontend can directly retrieve data from it. This can ensure system security and improve efficiency. Therefore, the subgraph (capturing on-chain events, off-chain storage, supporting logical processing) infrastructure has developed rapidly, as shown in the orange part in the picture. We call it: V2 version architecture

image

V3: Of course, if the business is too complex, we can encapsulate the part that interacts with on-chain contracts independently, allowing the frontend to focus on presentation and the contract to focus on logic. Therefore, the SDK is introduced, which specifically handles all the logic of interacting with on-chain contracts and performs corresponding business processing, always ready to feed the frontend. At this time, we call it: V3 version architecture

image

V4: Later, blockchain storage projects also emerged one after another, among which the most well-known is: IPFS. It is a project dedicated to large file storage. In the recent popular NFT projects, all images need to be uploaded to IPFS to save Ethereum network fees. Therefore, the design changes as follows, and we call it: V4 version architecture

image

The development of blockchain infrastructure projects brings some flexibility to system design. Among V1 to V4, there is no best design, only the most reasonable design. Architectural design can bring reasonable division of labor and provide efficiency.

But only the design that fits the business scenario is meaningful. As developers, we must not pile up technology for the sake of coolness, which will result in over-design. This often only satisfies the vanity of developers, but brings inefficiency and high costs. We should resist temptation and choose the best solution as much as possible during the development process.

The web3 technology stack is not complicated. Traditional Internet backend technology is not necessary for web3 development, but it is optional. You need to master:

  1. Basic knowledge of blockchain: addresses, tokens, asymmetric encryption, hash, consensus;

  2. Solidity: Writing smart contracts, which is the core part of the entire dapp;

  3. Node.js: This part must be proficient because frameworks, unit tests, scripts, etc. are all operated using JavaScript (JavaScript is the most mainstream, but Python, Java, etc. are also available);

  4. Web3 SDK: The mainstream web3 libraries are web3.js or ethers.js, and all operations related to on-chain interactions are performed through these two libraries;

  5. Subgraph: This is a third-party infrastructure service that can capture on-chain events (scan the chain, calculate, store in Postgres), thereby integrating data and making it convenient for frontend calls, greatly facilitating developers.

  6. Frontend: React (used in large projects, native support for well-known protocol libraries is more comprehensive), Vue

  7. Backend (optional): Robots, periodic calls to contracts, listening to chain scans (wallets), and other requirements

image

Minimum technology stack: Solidity, Node.js, Web3, Subgraph, Frontend. (Assuming you are a developer, Linux, etc. are not mentioned)

These parts are the minimum technology stack for developing dapps. Mastering these skills will give you the basic skills to read and write dapps, but this is far from enough. Mastering the technology is just the beginning. The specific subdivision of business is what we need to focus on. Only business can make you an expert in a specific field, and technology will always be just a tool. We will explain this part specifically in the future, so don't worry.

image

Team Composition

Dapp development only requires a small team, usually 4-5 people, with specific responsibilities:

Contract (1-2)
Subgraph (1)
SDK (1) (Optional)
Frontend (1-2) (more)
QA (knowledgeable in coding)

More frontend developers are needed because often contracts are written in half a day, but the frontend needs to be written for a week. That's love.

The presence of QA must be valued, and not only end-to-end testing on the page, but also direct testing of the interfaces of the contracts one by one. This can maximize security.

Development Process

Requirement analysis -> Development -> Joint debugging -> Testing on testnet -> Testing on mainnet -> Contract audit -> Deployment -> Contract upgrade
Design Principles

Focus on determinism (immutability) rather than efficiency
    Separate data and logic for easy upgrade
Open source code, completely public data (transparency)
    Refuse to store any sensitive information on the chain (including fields marked as private)
    Clear logic, good permission control
    Unit testing
Be prepared to deal with attacks at any time (security)
    Always assume that the contract has been successfully attacked and have remedial measures (emergency pause, reserve funds)
    Do not reinvent the wheel, use verified code (similar to encryption algorithms)
Pay for interaction (when writing data)
    Avoid putting unnecessary data on the chain (on-chain vs off-chain)

Mastering the basic toolchain is the first step in a long journey. The web3 world is changing rapidly, and there are endless business opportunities. However, mastering the technology is always the most important part. Come on, let's get started!

Solidity Job Requirements#

For reference only. Junior: syntax, Intermediate and Senior: syntax + protocol, Expert: syntax + protocol + upstream and downstream technology stack

Junior#

Blockchain Ecosystem Development Engineer

Responsibilities:
Design, develop, and port blockchain ecosystem development tools;
Design, develop, and port blockchain ecosystem applications;
Build DAPP cases as production code references;
Optimize the development experience of blockchain networks;
Keep up with the latest developments in blockchain ecosystem technology;

Requirements:
Bachelor's degree or above in computer-related majors;
Experience in decentralized application or smart contract development;
Familiar with the basic principles of mainstream blockchains such as Bitcoin and Ethereum;
Strong learning ability, excellent logical thinking ability, excellent analysis and problem-solving ability;
Good teamwork spirit, dare to accept challenges, pursue excellence;

Intermediate and Senior:#

How to become a qualified senior smart contract engineer:
1. Familiar with the Solidity language and able to use hardhat for automated testing, optimization, deployment, interaction, and SDK encapsulation of smart contracts.
2. Familiar with all the library files of Openzeppelin and able to deploy and upgrade upgradable contracts.
3. Familiar with the implementation of mainstream smart contract projects on the market: dex, lending, staking, oracle, bridge (at least two of each)
4. Familiar with inline assembly, clear about the GAS consumption of smart contract execution, and able to optimize smart contracts to the maximum extent.
5. Familiar with mainstream EIP standards, keep up with the progress of EIP proposals, and be able to write analysis of new proposals.
6. Familiar with the differences between different versions of Solidity and keep up with Solidity version updates.
7. Familiar with the steps of compiling Solidity into bytecode and able to reverse-engineer the execution steps of smart contracts from bytecode.
8. Familiar with the principles of smart contract execution on the EVM and able to make blockchains EVM-compatible.
9. Familiar with other mainstream smart contract languages and mechanisms (such as Rust and Move).

Expert#

What are your responsibilities?
1. Implement EVM-based smart contracts
2. Review EVM-based smart contracts and audit security issues
3. Support frontend developers in building and maintaining web applications that call smart contracts
4. Deploy and maintain existing smart contracts
5. Manage wallets used to deploy and operate smart contracts
6. Actively propose improvements to our products and internal processes

What are the requirements?
1. You are an expert in smart contracts and Solidity
2. You have a deep understanding of the EVM and knowledge of smart contracts at the opcode level
3. You are familiar with the source code of at least one Ethereum node implementation
4. You have a deep understanding of JavaScript basics, modern tools, and ecosystems
5. You are proficient in using web3.js and ethers.js libraries
6. You have some frontend development knowledge and some understanding of React

What's good to have?
1. You are passionate about blockchain technology and decentralized future
2. You are contributing to the open-source community
3. You have considered and feel comfortable, or have experience working in a startup environment

Expert#

You are:
● Experienced in building excellent products in the decentralized finance field for more than 2 years
● Deeply understand decentralized finance, decentralized protocols, DAOs, cryptocurrencies, blockchains, and EVM
● Have experience with web3 frameworks and interfaces with Ethereum nodes and services (Geth, Hardhat, Alchemy, Infura, Tenderly, etc.)
● Have experience deploying complex systems on Ethereum
● Quick learner and independent
● Able to work efficiently remotely and communicate effectively

Nice to have
● Graduated with a degree in computer science, mathematics, or engineering
● Experience using smart contracts to implement complex mathematics
You will:
● Be involved in the entire development lifecycle, focusing on design, coding, and debugging
● Build reusable code and libraries for future use
● Optimize the performance and scalability of applications
● Implement security and data access
● Provide clean APIs for different clients

Third-party nodes: https://dashboard.alchemy.com/apps (for Dapp use only)
Third-party nodes: https://infura.io/ (for Dapp use only)
Official nodes: https://rpc.info/ (can be used for graphnode data synchronization)
Other rpc nodes can be obtained from: https://cointool.app/rpcServer/eth
BSC testnet rpc: https://chainlist.org/chain/97

image

Ethereum Architecture#

image

Solidity Basics#

Ascii (for easy reference)

image

Lazy, etc.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.