Labs

Expanding the Frontiers of Blockchain

2key Labs is the innovation arm of the 2key network. Headed by 2key Chief Scientist Udi Ben-Reuven and managed by 2key CTO eiTan Lavi, 2key Labs is focused on developing breakthrough blockchain technologies to help ensure blockchain’s future is truly decentralised, scalable and accessible.

2key Labs has already developed 3 patent pending technologies that form the basis for the 2key network. Our revolutionary Multi-Party-State-network technology lets 2key network participants effortlessly interact with smart contracts simply by sharing links through their regular browsers and enables the entire 2key network to easily scale-out.

2key Lab’s current pending patents, which are already deployed in 2key Network include the following technologies

  • DECENTRALIZED NETWORK FOR MULTI-STEP REFERRAL AND ACQUISITION TRACKING [US Patent Docket No. 09712.001PV1]
  • DECENTRALIZED PROTOCOL FOR MAINTAINING CRYPTOGRAPHICALLY PROVEN MULTI-STEP REFERRAL NETWORKS [US Patent Docket No. 09712.002PV1]
  • DYNAMIC INCENTIVE MODEL FOR REFERRAL AND ACQUISITION TRACKING IN DECENTRALIZED NETWORKS [US Patent Docket No. 09712.003PV1]

Layer 2 Solution for Ethereum

Currently, the lab is focused on developing a general purpose Layer 2 (L2) solution for running any smart contract on browser-based Multi-Party-State-Networks (MPSNs).  The solution is the lab’s main goal for 2020 and includes several pillars.

Developing a solution for deploying and interacting with smart contracts through browsers in a scalable and accessible manner is a challenging feat. Any solution designed for this purpose will require the following essential characteristics in order to be effective:

Support running any solidity code.
Enable to utilise zero-knowledge methodologies to efficiently persist transaction state graphs with up to hundreds of millions of transactions into the Layer 1 (L1) main chain (e.g. persist a contract with very large amount of votes into the main chain) with just one L1 transaction which can be validated in milliseconds.
Touch L1 mainchain only upon contract creation and resolution.
Allow buffered offline persistence into L1 in case all the state graph has to be publicly saved.
Allow a single quickly validated L1 transaction to save the final valid state of the MPSN.
All transactions in the contract except the creation of the contract and final persistence into L1, should be facilitated solely by p2p direct communication between browsers or their human users participating in the MPSN. This means zero reliance on centralised infrastructure for maintaining interim consensus in the MPSN while it is being run off-chain.
Contract parties can join dynamically, no need for them to be known in advance, and no need for any multi-sig wallet to be created for them in advance.

2key Labs Mission & Roadmap (03.2019)

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 utilising these nanochains, keeping real-time consensus for the entire contract participants will require direct line of communication to be maintained only between a node in the contract’s state graph and its immediate children. This will greatly optimise 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 it wasn’t co-signed by the appointed miners 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 actually 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 which 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 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

We're developing a DAG indexing system, basically an encoding/decoding mechanism, which 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. In contracts with up to a few thousand transactions, this approach enables 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  big 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 run-time  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 easily interface and interact with them. 2key will offer a zero-integration platform for end-users, while allowing them to enjoy the security and decentralisation 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 offer users smart contract capabilities that require zero integration with the L1 blockchain itself.

Key Benefits

Saves users the need to open crypto-wallets upfront.
With 2key’s solution, opening a crypto  wallet can be delayed until funds need to be pushed in or pulled out of contracts. For all other transactions, it’s possible to interact with smart contracts without a user-managed wallet. This has significance for UX and adoption, because the  process of  opening a wallet is long and could drive away users, especially when taken together with regular onboarding funnel of login or signup.
Admits only verified users to participate in the contracts.
Contrary to  L1 blockchains, 2key network only connects between people. Verification of user identity and humanity is set as a pre-condition for registering into the network and participating in contracts.
Highly scalable
No overhead of resources for running the contracts are necessary, because regular web browsers act as nodes in the network, utilising novel cryptographics for verifying and generating transactions in the contract. For this same reason 2key’s MPSN Smart Contracts as a Service is both highly scalable and secure, as opposed to running all of a contract’s transactions on decentralised L1 chain, which will raise scaling issues, or using a centralised network to manage state, which results in security issues.
Enables users to join contracts by sharing links
2key links enable anyone to join into a smart contract simply  by receiving a 2key link from another participant in the contract. This makes interaction with smart contracts a simply “press and play” process, requiring zero prior knowledge or domain knowledge.
Cheaper than running everything on L1.
Running most transactions on an off-chain decentralized network ensure that transactions costs for users stay much lower than if they were running all transactions on the main Ethereum network.
Eliminates the need for ETH in  running contracts:
2key MPSNs maintain most transactions in the contract in a strict p2p off-chain manner between participating browsers. For the txs that must be sent to L1 (usually at contract start and conversion), 2key protocol employs novel meta-transaction approaches where decentralization is kept by having users cryptographically signing txs on the client side, while relaying the txs to the 2key backend which then funds the txs with ETH and relays them forward to the L1 (EVM - Ethereum Virtual Machine). This means that users of 2key don't need to have ETH in order to create, interact and utilise smart contracts.

Future Perspectives: Game Theory AI

Once 2key network launches and starts aggregating user data, 2key Labs will be tasked with starting to develop, implement and optimise utilising Machine Learning a general purpose incentive model for online sharing. This model will be built to dynamically optimise 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.

Creating the Future of Blockchain to Improve Humanity

Highlights from the 2key Labs Blog