It’s been pretty busy over the past few months for Ethereum javascripters. For starters, there was a huge hackathon with IPFS. You can read the excellent article by Dan Finlay here.
Also, during this time Aaron Davis (fuck it) made excellent progress towards a lightweight JS client using IPFS libp2p to build a mesh network in the browser and IPLD to provide the merklization layer. This will be important work in the future to build pure clients in the browser. too Casey Detrio worked on a standard json rpc test suite, in which you can see the results of here.
After the Seattle meeting, we (axic Y Homeless) sat down during a week-long hackathon in Budapest to go through some details of ewasm. Elsewhere in the JS world, Fabian is doing a major refactoring of Web3.js for version 1.0, while Nick Dodson has been busy with etc.. The remainder of this post will outline the various projections this technology could provide, as well as go into some detail about each individual project. All of these projects are open source and encourage community participation, so if you’re interested, check it out, say hi, and send a PR if you have time.
EWASM
by ewasm The goal is to investigate and replace the EVM with web assembly and second, implement a client for the current system that can be JITed (or transcompiled) to WebAssembly.
An important part of evaluating WebAssembly for blockchain use will be creating a testnet and this year the Ewasm team will focus on bringing that testnet to life. The work of the test network:
- enable practical work with ewasm for a wider audience
- Allow related work to be done, such as experiments with Casper, by providing a flexible platform for experimentation.
The ewasm track is dedicated to ewasm research and development, while the client integration track will be dedicated to developing the network and creating full featured thin clients. But there are many shared components in these two tracks. The Ewasm project is divided into two main components: the core layer, which handles IPC and manages state, and the central virtual machine. This should allow us to use the same framework for different VM implementations.
In summary, the main tasks of ewasm are:
- Create an ewasm testnet
- Creating a reusable “core” module
- Renew ethereumjs-vm
- Use ewasm-kernel for message passing
- Implement the latest EIPs
- Ewasm integration tools
- solidity-ewasm integration (next effort for solidity hackathon!)
Join the implementation effort! We have biweekly meetings on Tuesdays. Our communication channel is in Matrix at cousin: matrix.org (or #ewasm on IRC or on grid)
networks
There are several reasons to have an Ethereum networking implementation in JS. For one, it would allow us to implement a complete and lightweight Ethereum JS node. These thin clients would run in both a node.js environment and in a browser. A prerequisite for a thin client in the browser is “bridge” nodes. These nodes can also act as signaling servers For him webrtc network that browser thin clients would use to relay messages from the RLPx network to the webrtc network. This work is being spearheaded by Metamask using IPFS’s libp2p. He too RLPx The implementation was recently renewed by fanatic.
IPLD
The Ethereum blockchain and on-chain state can be understood as a graph of hash-bound data. IPFS/IPLD It is proposed as a generic system for describing and distributing hash-bound data. Therefore, we can describe Ethereum as an application layer on top of the hash-bound data availability platform. As proof of concept, fuck it implemented IPLD resolvers for Ethereum data formats that define where hash links are encoded within Ethereum’s canonical formats (for example, block and state trie node). This, combined with other generic features of libp2p (the IPFS generic p2p networking stack), allows for the creation of minimal Ethereum clients that focus on the consensus protocol and state transition mechanism. An advantage of this approach is that the network layer is transport independent and can be used in environments that do not have access to tcp/udp (such as the browser) that standard Ethereum clients require. This project is still in the research phase. MetaMask hopes to use this approach to deploy a browser-compatible Ethereum thin client over a secondary network, joined by hybrid nodes.
Web3.js 1.0 incoming!
A new version of web3.js is being prepared. It is the largest codebase refactor since the inception of the popular Ethereum library. That it will have many convenient features such as confirmation and receipt event on transactions, a nice subscription API, and checksum checks on address inputs.
The API isn’t finalized yet, but if you’re eager to take a look, you can check out the docs. here.
The new version will also have some breaking changes, but those updates are necessary to get the new API properly and to remove some deprecated methods along the way, such as synchronous calls. 1.0 will only have promises and in some “PromiseEvents” events to better reflect multiple events in the execution of a transaction. For those thinking of transitioning their applications to the new web3, there will be a migration guide at launch to help make the transition from 0.xx as smooth as possible.
In Mist there will no longer be web3 exposed by default, as this encourages a bad habit of relying on the web3 provided by Mist, making breaking changes disastrous for dapps. Instead, there will be an “ethereumProvider”, which libraries like web3 can use to communicate with the underlying node. Web3.js will automatically detect any given provider and expose it in its API for easy instantiation.
For those who can’t wait and want to try it right now, check out the 1.0 branch on the web3.js repository. Keep in mind that there could be dragons!
ethjs
ethjs is a new lightweight and highly optimized JS utility for Ethereal oriented to work with json RPC, very similar to web3.js but lighter, only asynchronous and using bn.js. Current ongoing activity includes:
- Add ABI methods to decode records in ethjs-abi
- Having fixed a small decoding bug in ethjs-abi (handling of 0x addresses)
- New merged schema for personal recovery and signing ethjs-schema
- Looking for help making ethjs-filter stateless (Infura ready)
- Bug fix in ethjs-contract
- Documentation updates everywhere
- ethjs version 0.2.7 coming soon!
TestRPC
Working on version 4.0.0! This release will include:
- Database persistence. You can now create a test string and save that data, just like any other private string!
- Cleanup of how data is stored in memory, which should significantly reduce memory issues. Although there will be a small performance cost, which you will mostly not notice unless you are doing thousands of transactions, it will bring a big increase in stability.
- Wrapped for the browser (vendor only).
- Easier installations on Windows and possibly other platforms.
We will move the TestRPC to the truffle github organization as it is mainly maintained by the Truffle developers. There are important new TestRPC plugins on the way. And we’re investing significant energy in the documentation and branding that unifies it under the Truffle brand. Any feedback on this move is appreciated. Lastly, TestRPC needs a new name that exudes everything it can do. If you have an idea let us know!
Community
The Ethereum JS community is an exciting and wonderful thing to be a part of. There are many great projects underway. If you are interested in connecting, we have weekly meetings on Fridays at 3:00 EST / 10:00 PST / 18:00 UTC. To watch our grid channel for the chat link. In addition, we are organizing a next hackathon. Let us know if you are interested.
APPENDIX (March 22, 2017) – Please note that some of the projects in this post are not directly supported by the Ethereum Foundation, but have been included as they are relevant to the overall Ethereum JS ecosystem update by the author .