Editor’s note: this is the secret ape technology engineer jin-yang jiang lecturer, block chain in organized by the nuggets technology community, etheric lane community foundation, fang lovers and ConsenSys co-host of the etheric fang “developers start guide | Jeth ii – hangzhou field of activity on the share consolidation. Jeth’s series of offline activities centered on the theme of Ethereum technology development. Every issue of Jeth will invite excellent technical teams and engineers in the field of Taifang development to share technical dry goods offline. It aims to provide offline technology exchange and interaction opportunities for developers to help them grow.

Share video replay link (Station B)

Let me introduce myself first. I am Jiang Jinyang, a blockchain engineer of Miape Technology. The topic of this time is how to achieve a simple Ethereum. I was engaged in Web development and cloud computing development. It was two years ago that I first came into contact with Ethereum. As a technician, we not only value ethereum, but also this generation of blockchain technology.

To be honest, I was disappointed when crypto cat was at its height. Ethereum was supposed to be a decentralized computer all over the world, but someone made a cat out of it. As I get to know and learn more about Ethereum, I see many apps fulfilling ethereum’s mission step by step, using decentralized functions in depth, such as the DAO project.

Although the DAO project failed due to the loophole of smart contract, the function of using smart contract DAO impressed me. DAO refers to a decentralized autonomous organization. In the PROJECT of the DAO, I can transfer a sum of funds to the project with my private key and get the corresponding voting right to vote on where to invest my funds. The DAO eventually died, but it was a big step up from crypto Cat.

Decentralized exchanges

You’ve heard of decentralized exchanges more or less, but the idea behind decentralized exchanges is to secure them with smart contracts. We assume that there is now a well designed, using the intelligent decentralized exchange contract, theory of my assets in exchange inside trading above, may be part of the deal all centralized services help me match the trading process, but the money is through my private key, and to control the etheric fang intelligent contracts, such assets will be in my hands.

Smart contracts and Web 3.0

Through these examples, I feel that the concepts of smart contracts and ethereum Web3.0 live up to their hype. There are two characteristics in the two examples just mentioned:

  1. The funding and mechanism are open and transparent, such as the DAO project.
  2. As a user, I have 100 percent control over my money, which is a luxury in today’s Web centric services.

The Web – BlockChain

Blockchain

Blockchain is a Web3.0 platform, and to be involved now is to create a platform for the next generation of developers, which is the biggest attraction for me.

The secret ape technology

When I first heard about Mixiape, I was impressed because the company’s projects and main products are open source on GitHub, including wallet and blockchain browser, and the License is quite open. This also meant THAT I didn’t have to pay to use their code, so to learn how the company works, I decided to join in.

One more thing, I heard that Secret Monkey Technology they are called Shaolin Temple, I was wondering why shaolin Temple, if there are no girls in the company, they are all men. This misunderstanding was soon revealed: the meaning of Shaolin Temple is “the world’s martial arts come out of Shaolin”, and the Secret Ape has indeed cultivated a large group of disciples like Emei and Wudang in the current blockchain ecology, making their own contributions to the blockchain cause.

Interview: Web → blockchain

I went to the interview of Miyizhu Technology, which was quite awkward at that time. I was born in the Web, and I had only heard about the concepts of block and consensus in blockchain, but I didn’t have a deep understanding of them, so I had no idea at the interview. At that time, I applied for the position of Web development. Fortunately, we had a probation period, so I encouraged myself. If I could thoroughly study the knowledge during the probation period, I could transfer to the development direction of BlockChain. On the right is the technology you need to get into the Web3.0 platform.

Secrets of blockchain engineers

During my interview, the boss reminded me that many of the blockchain engineers of Miape Technology were also from the Web industry. There is a secret that can make you learn blockchain development quickly, which is called “wanhuan”. Many of our colleagues have done some implementation of Bitcoin and Ethereum. In this process, you have gone a long way from the Web technology stack to the BlockChain technology stack. At this time, you have made the BlockChain, and you do not need to ask yourself whether you are qualified to do the BlockChain.

The tradeoff of chain lifting

The advantage of masturbation is that I can become an expert in Ethereum. When I decided to masturbate, I chose ethereum, the second generation of blockchain, rather than Bitcoin, the first generation.

This is our company’s masturbation culture. Our CEO was the first one to do it. I asked him if there was any value or sense in working on Ethereum, since it would take two or three months and cost and not always be possible. He told me that it was hard to wank Ethereum, and he encouraged me that if you can wank a piece of Ethereum, it means your understanding of blockchain can reach the TOP 5 level of our company. My consideration is to do it or not to do it. The boss later said in the company, who can realize Ethereum, double the salary. In line with the idea of helping leaders share their worries and helping bosses spend money, I decided to do Ethereum.

I started it and now three months later, three months later, I don’t have time to show you what it looks like. Here is a screenshot of my GitHub project home page (https://github.com/ciri-ethereum/ciri) :

The difficulty curve

In the process of doing this, I had this difficulty curve, and the first one was the Ethereum Wiki, where you can find all the access to ethereum materials. If you want to implement the core of Ethereum, you have to go to the Ethereum Yellow Book written by the technical partners of Ethereum, and you can see a lot of formulas in the book, and it’s very, very difficult. As we all know, Ethereum is a work in progress project, there is no fixed specification, it can be understood that the ethereum specification changes every day, in many cases you need to debug your client so that you can understand the current implementation. The Yellow Book is a huge hurdle, and once you’ve read the Yellow Book and understood the existing ethereum implementation, there’s a lot more to do, but it’s a lot less difficult, and the rest can be done over time.

Ethereum test project

Sets the initial state of the chain

Let me introduce you to a GitHub project called Ethereum Tests. As we mentioned earlier, ethereum specifications are changing all the time. This is the only project that tracks changes in ethereum specifications.

If you look at the project catalog, there are only 3-4 frequently updated directories with thousands of tests in them. Here are a few tests:

  • Testing of BlockChain, mainly involving validation of Ethereum blocks, and some other tests such as POW, is testing consensus algorithms.
  • RLP test, RLP is an ethereum encoding library, similar to JSON but Ethereum chose LP as the format.

I’ll show you how the tests library works and how to ensure that ethereum is implemented.

  • Sets the initial state of the chain

The idea is very simple, you give me a FILE in JSON format, and in that file is its initial state. The picture on the right is its format, we can usually see the address of the wallet; Balance is the balance of your wallet; An address with an empty code represents a wallet, not a contract, which would have a code; Storage is some data stored in our contract. The address below is the address of an actual contract. I’m going to set the initial state of the chain based on this piece of data, and I’m going to plug this piece of data in.

  • Input block data

The second part it will provide some input. The example I use is the block of BlockChain, which consists of the bulk and a bunch of transactions, and is then implemented into the test, where it executes the corresponding contracts based on the contents.

  • Verify the state after processing the block

Both transfer and call contract are presented in the form of transaction in Ethereum. In this process, it is equivalent to the initial state of a computer, and this state needs to change. I will verify whether the changed state is consistent with the state in the test.

There are over 8,000 of these tests, and my project has passed over 5,000 of them so far, with a lot of ethereum fork rules left unaddressed, so the rest of the tests should be fairly easy to pass.

The rest of the results

I have published a portable RLP library in Ruby on GitHub called Ciri-RLP. At the same time, many of our company’s background is written in Ruby, and my colleague used cirI library to solve the encryption problem.

How to implement Ethereum

Reflections and Suggestions

  • The specification for Ethereum
  • How do open source projects get developers thinking

How to understand the specification of Ethereum

As I said earlier, there is no complete specification for Ethereum, but the specification is nonetheless very useful: first, if you want to implement a client, you have to understand this thing; Second, if you don’t implement a client and you want to do ethereum-related development, for example you might develop a wallet like imToken, a browser for blockchain and other things around Ethereum, you also need to understand the specifications of Ethereum. Sometimes just looking at the Wiki and article organizing specifications is not enough for you to implement this thing.

As an example, I use DevP2P, an underlying network component of Ethereum, which connects to nodes in a P2P manner and communicates freely with upper-layer applications.

There are three places where we can find authentication specifications for DevP2P.

The first is a Wiki, which is sort of a general entry point for all of Ethereum’s data, but you probably won’t find anything particularly detailed inside. The screenshot on the right of the slide shows the Wiki introduction to Libp2p, which tells you what Libp2p is. But this is just telling you what it is, not telling you in detail how to do it.

The second diagram shows the protocol of Devp2p. Libp2p is Devp2p, but it doesn’t tell you in a very formal way, so you can’t implement it just by looking at the protocol. The Yellow Book is essentially the EVM specification of Ethereum, it is written in EVM things, but the network part of the words can not be found in it.

Another thing you might look for is EIPs, which is a community-driven ethereum enhancement proposal. If you find that Ethereum is not doing well, I can promote it, you can submit an EIP first, and if the authorities think the EIP is good, they will assign the NUMBER of the EIP, and the rest of the community will discuss it and finally implement the proposal. Most of the specs we have for Ethereum right now are in here, so you have to look for EIP stuff.

Unfortunately, there is no very detailed specification for Devp2p in EIP, so use the official client to look at its code and debug it.

We can use Geth to do this, which is what I did when I printed out the data that Geth received paragraph by paragraph. And then compare.

How do open source projects attract developers

Next I’d like to share how open source projects appeal to developers. The key to open source projects: a bunch of people working on a project can determine whether it gets started, and if it’s going to last, more people have to be involved, including Ethereum.

This is the official client supported by Ethereum, py-EVm, and the other one is implemented by me, Ciri. At this time, I need to consider how to increase participants, which needs your help. If you’re interested in implementing Ethereum, in learning more about how ethereum works, the best way to do that is to implement it yourself; The second good way is to get involved in the project and do it together; If you don’t want to know more about Ethereum, please give me a thumbs up for my ciri project, which is also a help for open source projects.

Lower the barriers for developers to participate

  • Manage projects in an open source manner

As I was doing it, I made a comparison, and I found that a lot of things were still missing. All of you in this room are programmers, and if you were working on your own projects, you wouldn’t document at all, and you wouldn’t think about project management. If you want someone to get involved in the project at this point, ask them to look at your source code. When I think about this, I started managing the project in the GitHub issue.

  • The README and Roadmap

If others want to get involved, see what I’ve done, why I haven’t done it, and where I’m at with the Roadmap, including writing a detailed README and Roadmap document.

  • Easy Setup for developers

I think it has gone beyond many open source projects. I made a Docker image for developers to use. If you have Docker on your computer, you can take the container to test whether there are really more than 5,000 tests that can be passed, saving the trouble of installing dependent files.

conclusion

If you understand the ethereum specification, or if you want to learn more about the implementation and design of Ethereum, there are three ways to keep in mind: Yellow Book, WIKI, EIPs, and further debugging with existing clients. Second, think about how to participate in open source projects, covering open source approaches and managing projects, providing readme and ROADMAP documentation; The third is to make it as easy as possible for developers to learn about the project.

  • Contact: [email protected]
  • My blog is justjjy.com
  • Ciri Ethereum: github.com/ciri-ethere…
  • My wechat account is Fweedm

This is my contact information, as well as our recruitment promotion of Shaolin Temple, interested students pay attention to it. Thank you!