AlayaNetwork / Developer-Events

Community Verification Event for the Ethereum-compatible Version of PlatON | Alaya
MIT License
10 stars 17 forks source link

HackathonPLUS - Itheum > Trusted Computation Framework for Data Sharing #8

Open newbreedofgeek opened 2 years ago

newbreedofgeek commented 2 years ago

Project name: Itheum (World's 1st Decentralised Data Brokerage which aims to build a Trusted Computation Framework layer on Alaya/PlatON

Project repository:

Project overview: Itheum is a decentralised data brokerage. It's a cross-chain "Data DEX" that allows users to trade personal data securely on-chain (works on EVM chains). Itheum also allows for the storage of highly secure sensitive data within "Data Vaults" and we have a feature called the "Trusted Computation Framework" that brings the compute-to-the-data via privacy-preserving tech (like Secure Multi-Party Computation, Homomorphic Encryption and Zero-Knowledge Proofs). PlatON's Whitepaper shows the concept of a "Data Market" that forms a key component in their "Layer 2" architecture. Itheum will enable real-world programs like "OKPulse" and "Red Heart Challenge" and then uses the Data DEX for cross-chain data sharing. Itheum requires a privacy-preserving layer to handle the private data sharing and compute. The successful integration between Itheum and PlayON will demonstrate this working in unison. i.e. Itheum will be a highly valuable PlatON "Data Market" for real-world data sharing use-cases.

Project planning: We aim to deliver (at least) 4 Milestones that will establish the "Itheum <> PlatON Link" needed for the trusted computation framework to work.

Milestone 1 —— Deploy of Data DEX contracts to work with PlatON Total Estimated Duration: 1 Month

Number Deliverable Specification
0a. License Open Source License
0b. Documentation We will provide code description documents and basic tutorials, which will explain how to use our products.
0c. Testing Guide In order to ensure the integrity of the function and the robustness of the system, we will provide a test coverage of the code and explain how to run these test cases.
1. Module 1: 1 Work on efficient design and deploy our core Data DEX contracts to PlatON EVM via our deployment pipeline
2. Module 1: 2 Work with PlatON team and finalise correct integration pattern for next stage of trusted computation, the output will be a design guide on how we will proceed to next milestone

Milestone 2 —— Usage of Data DEX using PlatON wallet/identity Total Estimated Duration: 1 Month

Number Deliverable Specification
0a. License Open Source License
0b. Documentation We will provide code description documents and basic tutorials, which will explain how to use our products.
0c. Testing Guide In order to ensure the integrity of the function and the robustness of the system, we will provide a test coverage of the code and explain how to run these test cases.
1. Module 2: 1 Work with PlatON team to integrate our Data DEX login with the PlatON wallet or DID (like we do currently using metamask)
2. Module 2: 2 Allow user to use existing Data DEX features on the PlatON Blockchain (linking core Itheum Data Programs and importing data into the Data DEX for sale and also enable peer-to-peer data sell + buy)

Milestone 3 —— Enabling the Trusted Computation Sandbox - Design Total Estimated Duration: 1 Month

Number Deliverable Specification
0a. License Open Source License
0b. Documentation we will produce a shared architecture design that interfaces the Itheum and PlatON Stack.
0c. Testing Guide No code will be produced in this milestone
1. Module 3: 1 This is the most complex feature and we will need to 1st co-design this with the PlatON dev team - we need to design the method for how we will share Itheum data into a the Trusted Computation Sandbox that will use PlatONs privacy preserving tech for computation)

Milestone 4 —— Enabling the Trusted Computation Sandbox - Development Total Estimated Duration: 1-3 Month

Number Deliverable Specification
0a. License Open Source License
0b. Documentation We will provide code description documents and basic tutorials, which will explain how to use our products.
0c. Testing Guide In order to ensure the integrity of the function and the robustness of the system, we will provide a test coverage of the code and explain how to run these test cases.
1. Module 4: 1 Code the design from milestone 3 and allow for the Trusted Computation Framework to load data for privacy preserving compute)
2. Module 4: 2 Move data from the "Red Heart Challenge" program into the sandbox and enable for an algorithm to be run on it without exposing the identity of the data owner

Contact info: https://t.me/thisismarkpaul

LAT address: lat1s8jj72em6zanc57gudqxs7rxcps95nm69v8uq2

newbreedofgeek commented 2 years ago

[BUG]

We are working on Milestone 1.

As we connect to the PlatON Dev Testnet using Metamask / web3; the networkVersion also called network id is reported as "1"

"1" is Ethereum mainnet, it should report it as "210309" which is the PlatON Dev testnet network id.

image

I'm not sure where this bug is happening, there is a chance that the PlatON node (RPC node) is not reporting the correct network ID.

using this config: image

We are having a workaround on our data dex to deal with this until it's fixed: https://github.com/Itheum/data-dex/issues/51

biganxin commented 2 years ago

[BUG]

We are working on Milestone 1.

As we connect to the PlatON Dev Testnet using Metamask / web3; the networkVersion also called network id is reported as "1"

"1" is Ethereum mainnet, it should report it as "210309" which is the PlatON Dev testnet network id.

image

I'm not sure where this bug is happening, there is a chance that the PlatON node (RPC node) is not reporting the correct network ID.

using this config: image

We are having a workaround on our data dex to deal with this until it's fixed: Itheum/data-dex#51

@newbreedofgeek What is the exact error generated? Personally, I understand that the network identifier should be the 'chainid', and the screenshot of the chainid shows 0x33585 (decimal 210309)

newbreedofgeek commented 2 years ago

hi @biganxin

When PlatON network is connected, web3.js returns "1" for networkVersion image

All the other chains, return the chainID as networkVersion (converted to decimal). For e.g. this is the BSC testnet as per web3.js image

Usually all the other EVM compatible chains keep chainID and networkVersion the same.

In Itheum, we use net.getId() to toggle features of the data DEX as per: https://github.com/Itheum/data-dex/blob/main/src/App.js#L69

This explains the chainId and networkId - https://besu.hyperledger.org/en/stable/Concepts/NetworkID-And-ChainID/

newbreedofgeek commented 2 years ago

It's not a blocker for us by the way, we can work around it by using chainID... @biganxin

But the PlatON EVM interface via web3 seems slightly different that other EVM chains - so other developers may raise this as a bug

benbaley commented 2 years ago

In PlatON&Alaya the ChainID and NetworkID are different,normally the networkid is unrestricted, you can specify it with any value, in which case node can only be associated with nodes of the same network, strictly, we distinguish a blockchain by chainid, here are some examples: d137fead2f2dcba7203c2905a076f78

benbaley commented 2 years ago

@newbreedofgeek

the PlatON EVM interface via web3 seems slightly different that other EVM chains - so other developers may raise this as a bug

PlatON v1.1.1 and Alaya 0.16.1 are all compatible with EVM now, both devnet ware upgraded, you can try them Please give me feedback if you have any questions thanks

newbreedofgeek commented 2 years ago

@benbaley tnx!

we now use ChainID in our DEX and it works fine, we will let you if we have any other questions...

biganxin commented 2 years ago

Project Progress 2021.12.10 Milestone 1:

newbreedofgeek commented 2 years ago
  • team

This PR has the Module 1: 2 so we can mark this [Completed] this as well. https://github.com/AlayaNetwork/Developer-Events/pull/63

View Design here: https://github.com/Itheum/Developer-Events/tree/main/Hackathon_PLUS/HackathonPLUS-Itheum-Trusted%20Computation%20Framework#module-1-2-work-with-platon-team-and-finalise-correct-integration-pattern-for-next-stage-of-trusted-computation-the-output-will-be-a-design-guide-on-how-we-will-proceed-to-next-milestone

biganxin commented 2 years ago

Good, Thank you for your hard work! An overview of the progress of the follow-up project can be updated here for easy confirmation~

biganxin commented 2 years ago

Issue feedback(50U) rewards have been issued (2021.12.29 Base Price 0.12)