2key New Partnership with the Enigma Protocol

eiTan LaVi
Aug 31, 2018 · 9 min read

The revolutionary partnership between the 2key and Enigma protocols enables a new class of smart contracts that are scalable, decentralised and protect users privacy. Yet perhaps the most remarkable feature of these contracts is their simple user-friendly accessibility.

The 2key and Enigma protocols are similar in that they both run in decentralised off-chain mode, only reconnecting with the main chain at predetermined times. This allows them to apply smart contracts in a way that is easily scalable.

Indeed, both protocols are designed to improve smart-contracts technology by dealing with some of its more problematic features. While the 2key protocol is designed to improve accessibility by enabling browser-based interface for smart contracts, the Enigma protocol tackles the issue of privacy by offering a privacy-driven computation layer for smart contracts. Through their partnership, 2key and enigma will create a new generation of smart contracts, with great advantages over existing technology.

To fully understand the significance of this partnership, let’s get to know both protocols in a bit more depth.

What is 2key?

2key’s protocol is entirely reinventing regular web links, by fusing them with blockchain smart-contract technology. This allows smart contracts to be played out, at scale, over regular HTTP links and by using regular internet browsers as the decentralised nodes of the network. The technology allows to change the state of contracts by simply sharing the links.

Technically, the way this is made possible is that 2key protocol creates an ad-hoc blockchain shard per contract, which any user can interface with using browsers. Web browsers can become independent nodes in the shard when the user links to the campaign via an HTTP campaign link.

2key is using its novel technology to build the 2key Network, which allows people to easily create, incentivise and participate in “social sourcing” campaigns for different goals. Social-sourcing campaigns allow people to combine their efforts towards common goals, by using their social connections and passing-on links and information through them. This enables to achieve powerful results through organically targeted online virality. A more detailed explanation of the network is found in 2key’s litepaper.

The 2key network relies on precise individual incentivization to motivate online sharing and collaboration. The 2key protocol enables to automatically reward each participant who’s contributed to reaching desired results. even if all they did was pass-on the information to the right people.

The network’s unique incentive model optimizes campaigns by rewarding participants according to a complex game-theory-based algorithm which takes into consideration dozens of parameters, including the relative result delivery-time, the referer’s relation with specific domains and their ‘reputation score’ of past successes and failures. You can read more about 2key’s incentive model here.

Building on Enigma

As noted above, 2key’s campaign optimisation builds on Game Theory models, which often require individual bids, rewards and other moderation parameters to be maintained private, allowing user tailored dynamics and role-based access.

Furthermore, privacy in 2key contracts is crucial, as it enables participants to safely input sensitive personal or business information, allowing 2key contracts to act on this data while ensuring other participants can verify data integrity and contract outcomes without compromising the data itself.

That’s why 2key campaigns build on the Enigma protocol to facilitate role-based, user-tailored access to data and event-driven analytics, which also ensures participants’ data remains private.

2key use cases for Enigma

2key is planning multiple use cases for the Enigma protocol in the 2key network, according to a detailed plan of action. The main building blocks 2key is aims to implement are as follows:

A. Encryption of Sensitive Data Used by 2key Contracts:

  • Sensitive data used for campaign optimization: For 2key contracts to optimise results we rely heavily on dynamic incentive models which employ Algorithmic Game Theory mechanisms. Part of the game requires certain data to be revealed only to specific users, per their role or location on the referral graph.
  • Converters’ personal information: converters in 2key contracts often require to disclose personal information in order to convert, either as identity checks, or just as part of the actual conversion event, e.g. in lead generation contracts converters have to insert their personal info in order to convert, or in petition/voting contracts where converters need to cast their vote in order to convert. Obviously, we require here the smart contracts to be verifiable by everyone, but with granular control on who gets to access the data itself, or else personally un-identifiable, yet verifiable aggregations/analytics over the data.
  • Business-sensitive contractor information: Contractors on the 2key network have to specify all kinds of business sensitive data, which they would like others to be able to validate, and the smart contract to act on, but then would not like to actually disclose. This can be their inventory, maximum possible rewards, maximum budgets etc..
  • Referrers’ personal information: In some types of contracts on the 2key network, e.g. token sale campaigns, there’s an option for referrers on the network to choose a manual incentive model, which more closely mimics standard distribution models. That is, instead of the Game Theory algorithm determining the rewards, these referrers prefer to choose their own cut of the maximum reward still left in the contract at the point where they joined, and then trying to distribute this onwards minus their chosen referral fee. In such cases, we require this cut to remain private, just like when you go to the store you don’t know the prices at which the store bought the products, so too, in such cases, the referrers are themselves businesses, and the price at which they got the goods is business sensitive to them, and requires to remain as such so that they can maximise their network in up selling the goods.
  • Participants’ personal Information in public registries: 2key network keeps a registry contract which stores participation and reputation data for 2key participants. It should be up to the user if they want to publish their data or not, yet, they would like the network to realise and act on their data, e.g. have their rewards reflect their reputation, even if it isn’t public, and have everyone else be able to verify that the rewards given were in respect to reputation.

B. Selectively Encrypted Event Sourcing And Event Based Analytics

All 2key contracts utilise an event source contract which publishes indexed events on every meaningful action happening in 2key campaigns. We require that these event be encrypted so that they are kept in selectively accessible manner, so that analytics on these, and actions on these can be carried out only be role-based or user-specific dynamics. For example, this would allow to show users their referral graphs just stemming from them onwards, and not the entire referral graph of all the contract, or in other access criteria, per the contractor’s specification.

C. Syncing Protocols For Maximum Smart-Contract Privacy and Accessibility via Web Browsers

This is a deeper level integration aimed to sync the off-chain vs. on-chain hits of both protocols, to allowed maximising throughputs and enabling full privacy and scalability in 2key’s offchain shards comprised of web browsers playing out 2key contracts.

Enigma.co

First Implementation

The following is a more technically detailed drill down into the first building block we’ll be implementing with Enigma: Encrypting referrer rewards in distribution based acquisition campaigns

At 2Key we developed a system which allows you to sell your fungible/non-fungible assets, such as your ERC20 coins, in a multi-level referral campaign. The campaign itself is a contract found on Ethereum network. You are the contractor who wants to motivate people to publish your campaign from one to the other until a new customer (Converter) is found. The campaign can be easily created with the 2Key supporting dApps which give you a link to the campaign — this is your sourcing seed link, the root of the referral graph for your campaign. You can then publish the link and wait for referrers to join or for converters to find it and use the link to purchase your tokens online. A referrer can use the 2Key dApp to customise the link and re-publish it. The customisation allows the referrer to be sure that if her sharing of this link was part in reaching a future converter, she she too would be rewarded for contributing in the successful information relay that led to the converter. Anyone getting the link from a referrer can also use the 2key dApp to customise the link again and then re-publish it thus forming a chain of referrals until finally a converter uses the link to purchase the product (e.g. Tokens) from the campaign. At that point of conversion all the referrals that were part of this converting chain are compensated with a bounty.

The bounty information is sensitive, as different referrals can receive different amounts of bounty depending on 2Key game theoretical algorithm that is used to optimise the motivation of the referrals to promote your campaign. We found that using Enigma we are able to develop a 2Key system that can keep the total available bounty and the amount of bounty each referrer receives hidden, while ensuring others of the overall data integrity and adherence to contract rules. The Contractor creating the campaign also sets a maximum bounty for each conversion. The 2Key dApp uses Enigma SDK to encrypt this value and store it in the campaign contract. Every time a convention happens the campaign contract is called. The code of the campaign invokes one of the Enigma workers to decrypt the encrypted bounty from the contract and to then perform the computation which results in nthe distribution schema of the maximum total bounty between the relevant referrers. The Enigma engine outputs is then used to store in the contract an encrypted bounty balance for each referrer. Every time a conversion happens the balance of the relevant referrer is increased.

At the end of an entire campaign each referrer will have a total bounty accrued from all the many conversions in which she was involved. At this point a referrer can call the withdraw method of the contract. This method uses the Enigma engine to decrypt the balance and pass it back to the method which transfers the total bounty to the calling referrer. The total bounty of each referrer becomes then public on the Ethereum network, however, at this point it is not possible to reverse engineer the output and break it down to the individual bounty earned by the referrer from each conversion she led to. As a result, at the time of the campaign, different referrers are not aware of how their bounty compares to others, and cannot then manipulate the campaign utilising various asymmetric information attacks or other Game Theoretic attack vectors. The base idea is that the game is kept on a personal peer to peer level, and rewards can be subject to personal decision without exposing more sophisticated or robotic players to unfair advantages stemming from mass scale or general data analytics. As 2key is planned for human use, we want to keep the playing field level and robot attack proof as much as possible.

Here’s a high level interaction schematic of the calls between the 2key contracts and the Enigma workers, for this use case:

2key :: Eingma Building Block 1 — Call Schematic

Our amazing Chief Scientist, Udi Ben-Reuven, will lead the tech front in developing the POCs and integrating the two protocols, and he’s also a co-writer of this blog-post.

Stay tuned, as we advance in our integration we’ll publish code samples and more detailed integration posts.

Thanks for reading!

We welcome any feedback — you’re welcome to comment here, Join Us On Telegram, or write us at hello@2key.network

~*~

eiTan LaVi

Co-Founder, CTO, CIO @ 2key.network

TG: @eiTanLaVi

eiTan LaVi

Written by

Co-Founder, CTO, CIO @ 2key.network

2key

2key

Re-Inventing the Link

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade