1. Fractal Consensus
Enabling a hierarchical-temporal consensus mechanism in which nano-blockchains (AKA nanochains) are dynamically created and resolved within subgraphs in the contract state graph. Each smart contract, once deployed on the main chain, then initiates a new Multi-Party-State-Network (MPSN), which will act as a dynamic blockchain shard per that specific contract. Resolving the general consensus of this shard utilizing these nanochains, keeping real-time consensus for the entire contract participants will require a direct line of communication to be maintained only between a node in the contract's state graph and its immediate children. This will significantly optimize the required IO overhead (Information Input-Output throughput-associated costs) of keeping dynamic state resolution in large state DAGs (Directed Acyclic Graphs in the contract's state machine).
The fractal consensus technology introduces the 2key sync nodes. These are dynamically appointed blockchain miners, which can be run on regular web browsers of 2key users not participating in the specific contract. Sync nodes facilitate the dynamic state-sync resolution between parent nodes and their direct children within state-subgraphs. In essence, no transaction sent by a contract participant in the MPSN will be honored, if the appointed miners didn't co-sign it for that participant's nanochain. Sync nodes are randomly appointed, and all identities of the parties and miners, as well as the transactions themselves, are encrypted using zero-knowledge methodologies to prevent collusions and biases. With fractal consensus, the state-graph of the smart contract being run on the MPSN is comprised of multiple nanochains, each syncing only atomic portions of the graph. This enables state DAGs of hundreds of millions of transactions between millions of users to run while keeping the number of peers who need to reach consensus constant at any given moment.
We're now advancing towards a provisional patent filing of this novel consensus mechanism targeted specifically for allowing light clients (web browsers) to function as full-fledged nodes (both transactors and miners) in MPSNs, running arbitrarily complex smart contract state-graphs.
2. Scalable Zero Knowledge methodologies for finality persistence into Layer 1
Even with a 2key MPSN supporting contracts with up to hundreds of millions of off-chain transactions, at some point, these transactions will need to be persisted on chain into the main Layer 1 (L1) blockchain that maintains full public consensus. There are three principal methodologies for achieving this goal, and 2key Labs is working on the development of all three.
3. Resolve the contract’s state-DAG into a single transaction referral chain
Basically, we're developing a DAG indexing system, an encoding/decoding mechanism that will enable scanning the contract's DAG and encoding it into a single transaction chain (TXchain). It will then be possible for each TXchain to be sent to L1 as a single transaction. The TXchain will be decoded in L1 by a smart contract that will translate it back to the multiple transactions it entails. For contracts with up to a few thousand transactions, this approach makes it possible to persist the contract's full state-graph into the main chain with a single transaction. For up to a few thousand transactions, this approach is expected to yield greater efficiency, higher speed, and lower costs compared with other zero-knowledge methodologies (e.g., zkSNARKs, zkSTARKs).
4. Buffered persistence
In cases where the contract's state DAG contains more than 2K transactions, the above approach of resolving DAGs into single TXchain can still be employed - iteratively. The main advantage of 2key's MPSN approach is that the contract's runtime will be handled off-chain on the MPSN, avoiding lags of waiting for L1 persistence. This means that the contract's persistence is transformed into an off-line task that can be handled without real-time constraints and can therefore be carried out over longer periods of time. So large contracts' DAGs can be split into sub-DAGs, of up to 2K txs each. Each of these sub-DAGs can then be persisted separately, iteratively, into the L1 blockchain, using this approach. This will allow to persist big state-DAGs into L1 with full tx details of all txs, without the contracts' actual runtime depending on the L1 blockchain's tx/sec rate limit, load-bearing, or other scalability constraints.
5. Zero knowledge compression of finality states
In some cases, such as in voting contracts where 1M people participate, but only the end result is important, it will be sufficient to persist only the final result of running the contract on the 2key MPSN onto the L1 blockchain. In these cases, zero knowledge (ZK) methodologies may be implemented to enable the computationally taxing stage of scanning the entire state-DAG and assembling a cryptographic proof of end-results, to be carried out entirely off-chain. This process will be carried out in a way that will enable to persist the off-chain-derived proof to the L1 blockchain, where a dedicated validator contract will verify the proof in milliseconds.
This will make it possible to converge into the L1 blockchain very large contracts carried out off-chain, with very little overhead. We are currently implementing a POC for 2key voting campaigns, which will enable to run the voting campaigns entirely off-chain. In these campaigns, voting will be carried out entirely off-chain within a 2key MPSN and the end results will then be proven and validated using zkSNARKs in a way that enables only valid votes to be counted and persisted on-chain to L1.
6. Smart Contracts As Service
Our aim in developing a general purpose MPSN L2 solution is to offer Smart Contracts As Service for other businesses, apps, and users.
2key network Smart Contracts as Service solution will offer an online platform where people and businesses will be able to enjoy a full SaaS experience for creating smart contracts, deploying them, and allowing others to interface and interact with them easily. 2key will offer a zero-integration platform for end-users, while enabling them to enjoy the security and decentralization features of robust L1 blockchains like Ethereum, without the downfalls of scalability and accessibility.
2key network will also publish a 2key-protocol javascript package for app developers and other integrators, which can be integrated into other applications. We're also aiming to provide API access to the full 2key protocol capabilities. This will offer app developers the opportunity to provide users with smart contract capabilities that require zero integration with the L1 blockchain itself.
Once 2key network launches and starts aggregating user data, 2key Labs will be tasked with starting to develop, implement, and use ML to optimize a general-purpose incentive model for online sharing. This model will be built to dynamically optimize bids and rewards for referrers based on their intra-contract reputation, long-term standing reputation in the contract category, and other factors. The baseline model will start advancing from the incentive model depicted in the 2key incentive model paper.