latest released version
What is Merklux
Merklux is a merkleized unidirectional data flow for state verification across multiple chains. Originally, it is designed to provide a way to verify state transition of the plasma chain on the root chain. While we can reduce the transaction costs by submitting only the block headers of the plasma chain, we don't have a way to verify the plasma chain's state transition on the root chain. It is because the nodes on the root chain cannot access the state of the plasma chain. Using Merklux, we can reenact the state transition of the plasma chain on the root chain. And for an efficiency Merklux manages the states with sharded namespaces and it reduces the transition costs for state transition verification.
And Merklux supports an accusatorial system to guarantee the state of the side chain. Plasma Plant is an implemenation of the plasma which uses an accusatorial system with Merklux.
npm install -g trufflenpm install -g ganachenpm install
Demo(work in progress)
Thus you can start the dApp for demonstration with the following command. (This demo dApp uses ReactJS and Drizzle)
npm run start
- Pre requisites
- Run a root chain and a child chain.
- Make state transitions on the child chain
- Deploy merklux smart contract to the child chain.
- Insert some items into the child chain.
- Get root edge from the Merklux of the child chain and store it as the original root.
- Get all nodes which are stored in the MerkluxTree at that time.
- Insert more items into the child chain.
- Get root edge from the Merklux of the child chain and store it as the target root.
- Make a proof case on the root chain.
- Deploy a MerkluxCase to the root chain with the original root and the target root as its construtor's parameter.
- Commit all nodes
- Insert same items into the MerkluxCase of the root chain
- Verify its state tranisition
Test cases include the information about how the functions work, but also includes a demo scenario. Running and reading the test cases will help you understand how it works.
npm run test
State verificationconst primary = '0xACCOUNT'
Please check MerkluxCase.test.js to get more detail information.
Sharded namespacesTo be updated
Merklux uses Christian Reitwießner's patricia-trie for its basic data structure. And he already mentioned that it can be used for verifying evm-based sidechain executions. Thus, this is kind of an implementation case of his idea.