GithubHelp home page GithubHelp logo

dev-help's People

Contributors

ainsleys avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dev-help's Issues

Error deploying secret node

From the forum:
https://forum.enigma.co/t/error-when-starting-node/1128

R0bb0 is trying to setup and deploy a secret node on his NUC device and having an issue starting it in HW mode.

If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Start 9 workers on your Secret Node. Note : 9 is the max amount of workers you can run.
Creating .env file from template
Running in Hardware Mode, as per SGX_MODE=HW in .env file.
NODES is set to 9
Error: SGX driver not found

@moonstash suggested he might not have enabled SGX in the NUC's bios.

I also added a link to the guide for deploying an NUC secret node, so R0bb0 can check to make sure he followed it exactly: https://secretnodes.org/#/tutorials/deploy-secretnode-nuc

“discovery init” error

forum question

The following error message shows up when I run “discovery init”.
my environment:
ubuntu 16.04
node -v : 10.17.0 (system install without using nvm)
npm -v : 6.11.3
discovery -v: 0.1.3

added 452 packages from 338 contributors and audited 62580 packages in 25.479s
found 2 low severity vulnerabilities
run npm audit fix to fix them, or npm audit for details
? Running in SGX Hardware (HW) or Software (SW) mode? (HW/sw) sw
? About to pull Docker images. This requires 15 GB of space. Continue? (Y/n)
Pulling Enigma Docker images...
(node:15396) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'row' of undefined
at Object.module.exports.pullImage (/usr/lib/node_modules/@enigmampc/discovery-cli/src/docker.js:64:33)
at /usr/lib/node_modules/@enigmampc/discovery-cli/src/index.js:183:18
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:15396) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:15396) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Create enigma dapp sample template

Hey guys, in my previous position I spent a significant amount of time optimising development workflow. Here is my opinion on how to improve the overall developer experience:

  1. Create a project template
  • The template should have a bare bones “hello world” implementation that encapsulates the whole project cycle.
  • It should include both the secret contract source and dapp source code, the developer will be able to use GitHub's template feature to quickly get started with no additional setup. Here is an example, see "use template" button.
  • discovery-cli can also use the template
  • Template should use and encourage .env pattern.
  • Readme should include instructions on how to setup enigma, setup the project, common pitfalls and performance tips.
    It should include a list of links to enigma approved examples and projects built by the community.
  • Template source code should include “helper” functions like this and overall reduce boilerplate (perhaps we can move these functions to an npm package).
    In my experience I had to do a lot of copy pasting while developing, especially during tests.
  1. Update examples to use the template, and keep them up to date with the latest template version.
    This will allow new developers to checkout the examples for help.

  2. Traditional bounties / Contest bounties

  • The bounty should require the developer to use the template.
  • The repository should be in the developer's account while in development.
  • Once the project is approved and paid out, it can be moved to the official enigma account.
  • Then the template readme can be updated to include the new project.

Most of the time developers will not need to clone all of the examples, the proposed plan will keep the commit's separated for each project, and by using versioning developers will be able to see changes due to protocol updates and etc.

Originally posted by @nionis in #19 (comment)

Standardizing the bounty solutions

We want to be able to bring all the bounty solutions together in our repo in some fashion, so that new users can use them as examples, fork them and build upon them, and so forth.

Option 1: create a new repo in EnigmaMPC for each bounty

Option 2: create a "bounties" repo which contains each bounty exactly as it is in a file structure

Option 3: create an "all samples" repo which enables users to get the enigma network up and running, and then deploy any of the contract they wish.

Challenges: Each bounty has it's own front-end, repo, server instructions... I am not sure how consistent they are.

This issue is opened so that we can provide feedback and do some research into which of these options is best (or if there's something better we didn't consider).

For reference, here are the bounty repos:

Benchmarking: https://github.com/nionis/enigma-benchmarking
NFT Lottery: https://github.com/nionis/enigma-non-fungable-token-lottery
Data validation: https://github.com/bshevchenko/enigma-data-validation
Access-Control: https://github.com/guix77/enigma-secret-access-control
Rock Paper Scissors: TBD

what are the differences between using pub interface public functions in contract implementation

Question in forum:

Summary:
What are the differences between using public_interface trait, then implement that trait for the public functions which will interact with UI part vs implement directly public functions right in contract implementation (not using pub_interface)?

Secondly, if I use pub_interface trait, implement it later, is there a way to point to &mut self if I call private functions in the public functions?

https://forum.enigma.co/t/what-are-the-differences-between-using-pub-interface-public-functions-in-contract-implementation/1076

Large scale data architecture?

forum post

bmiller59

Hi, Enigma team. I had a question about architecting large scale data storage and access efficiently from a performance and cost perspective while still preserving secrecy for the data. I was reviewing the secret voting contract that Taariq mentioned to me, and I see that all the data is stored in a HashMap that appears to need to be loaded in its entirety to read and write values to it. I am guessing that is not the production-app ready design for millions or billions of records, right? 😉 I know that Enigma has the engima-p2p service, but I have not found any guides how to use it effectively. In essence, I guess I am looking for something like orbit-db (https://github.com/orbitdb/orbit-db) but built on top of enigma-p2p? Please advise. Thanks!

unable to test signature verification because of errors

Peter (working on Rock paper scissors bounty) is blocked by the following errors

"Wrong epoch for this task” was thrown, throw an Error
Incorrect nonce yielding bad secret contract address
“Allowance not enough” was thrown, throw an Error

He isn't able to test out how to verify signatures because he's held up on these issues that are seemingly related to the testnet.

Discovery start isn't initializing all ganache accounts with ENG tokens

@lacabra when @levackt was testing my millionaires problem DApp he found an issue where ENG tokens aren't getting minted for 10th ganache account.

I've been reviewing discovery code to try to find where that happens. It looks like that account is being used by the Principal Node and that might be the reason why it doesn't have any ENG when discovery starts up?

Can a TEE "ring of trust" be wrapped around any layer of the Enigma Protocol?

https://forum.enigma.co/t/t-e-e-ring-of-trust-with-forcibly-distributed-token/1117

Econymous is asking:

If Enigma could make use of this contract model, there would have to be some type of “migration” function implemented. A transition. or potentially using Enigma to define a cluster of contracts associated with each other.
Unless there is some value that foam has in the centralized world.

The contract I created forcibly distributes the “resolve token” supply.
This distribution can be used to create a ring of trust, such as what’s needed for proof of stake sidechains.
I believe this ring of trust can be applied to devices associated with FOAM’s protocol. Bringing finality closer to the beacon event layer.

That is all. Just let me know if a “ring of trust” can be wrapped around any layer of your protocol.
I spoke to another member here a while ago about a research grant related to this idea.

cc: @ainsleys @lacabra

Eng_wasm crate documentation

forum post

Hi. I was wondering why the eng_wasm, eng_wasm_derive, etc crates are not documented, for example on crates.io? Can documentation for these crates be expected soon?
I have appreciated your tutorials and guides, but there is no replacing documentation at the crate level.

For example, when there is a wildcard use statement like use eng_wasm::*; and then there are references to mysterious types like H160 without documentation it is hard to know what is going on, how to manage type conversions, etc.

Looking forward to this crate documentation! Thx.

Have responded with link to the supported types, are crate docs being considered too?
Not sure where the repo is to confirm, but we may only need to run rustdoc to generate the docs before release.

Some queries regarding SGX

forum question

Researched SGX but I am mostly confused as to what it is.
I have some queries regarding SGX I’m hoping intelligent folks here would help me understand it
I get that SGX is a TEE
Can someone help me understand how does the SGX work?
I read it provides hardware security
My perception of SGX is that it is some sort of a sandbox insulated from OS and other apps.
Where does SGX reside? on the RAM ? or on the CPU?
How is it that it acts as a secure TEE while a normal computer doesn’t?
Can SGX be integrated into older Intel processors?(pre-SGX generation).
Say the nodes use non-SGX processors, won’t they disqualify to run as node for enigma network?
Some of the questions might sound stupid, I apologize for it in advance. But I’ll really be grateful if you help me understand it.

Mapping data structure

From discord dev-help

bmiller59: Hello. I had a question about Rust data structures that Enigma recommends/allows us to use, since stdlib is excluded. Specifically, at the current moment I am wondering how you would recommend I include a Map type in my secret contracts where I can lookup data in O(1) time.

Thanks. Something similar to the Solidity concept of a mapping.

Is it possible to append some data directly onto the state?

forum post

In the tutorial example, when adding a new address to MILLIONAIRES, get all the millionaires, append the new one to them, and override the current state. I think in the case that the data is large, it seems memory consuming.
The best would be to be able to append directly to the state, rather than overriding the entire state.
Does enigma protocol provide such a functionality? Or is it technically implausible?

fn add_millionaire(address: H160, net_worth: U256) {
let mut millionaires = Self::get_millionaires();
millionaires.push(Millionaire {
address,
net_worth,
});
write_state!(MILLIONAIRES => millionaires);
}

Computations over data

Forum question

Once I have put my data set on enigma to share with 3rd parties to compute over:

#1 Can I completely remove or erase the data? Or will it be there forever encrypted?

#2 Who can perform computations on that data? Only the person I give permission to or will anyone willing to pay the fee be able to compute over my data?

#3 once permission for computations over my data is given, can it be withdrawn?

Error compiling with extern crate “tflite”

forum post

I got the following error on macOS when compiling a SC with the extern crate “tflite” which accessed from local storage. When building only the crate the error does not happen. Any ideas what module could cause the error?

error: failed to run custom build command for tflite v0.7.0 (/Enigma/extern_crates/tflite)

Caused by:

process didn't exit successfully: /Enigma/secret_contracts/simple_addition/target/release/build/tflite-9a7a854401392085/build-script-build (exit code: 101)

--- stderr

/usr/local/opt/llvm/bin/../include/c++/v1/__config:1081:6: error: "No thread API"

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported

Stuck on task status 3

forum post

Hi! Whenever I try to use read_state!() in any contract and then run discovery test, the deployment will succeed, task status will go to 1, then get stuck on task status 3 forever.

To reproduce: from Ubuntu 18.04 with the discovery-cli, follow the millionaire’s problem guide, run discovery compile (succeeds) and the discovery test, leading to the following output (never ends):

Deploying Secret Contract "millionaires_problem.wasm"...
Smart Contract "Sample.Sol" has been deployed at ETH address: 0x2c5f3c004878923f55A2a255F89Fe29393177509
Waiting. Current Task Status is 3
What does each different task status mean?
How do I get unstuck from status 3?

Recommended error handling pattern for secret contracts?

forum post

Hi. I am writing some smart contract code in Rust, but I have a question about error handling. The usual pattern for error handling in Rust uses Result and Error. But I see in secret contract code their use produces the error

the trait eng_wasm::eng_pwasm_abi::eth::AbiType is not implemented for core::result::Result<(), Error>
So how should potential errors and known failure conditions be handled in Enigma secret contracts?

Are there Enigma client packages for interacting with contracts on android and ios devices?

This is a question in Discord, are there other clients in the pipeline or concrete plans?

] bmiller59: Hi all. I am interested in developing a mobile app using flutter that would interact with Enigma contracts. Are there Enigma client packages for interacting with contracts on android and ios devices? Any documentation about this? Thanks!
[4:32 PM] Taariq: Hi, @bmiller59
There's only a JS client at the moment. Docs are here if you haven't seen it yet, maybe Flutter can run JS.

https://enigma.co/discovery-documentation/IntroductionToEnigmaJS/
[12:26 AM] bmiller59: Thanks, @taariq. I'll see if that works for my needs. Any concrete plans to offer other clients?

Getting Started Part 3 Guide doesn't show how to run the front-end

From Discord:
(Nex)
i went through the getting started 3-part guide but it ends before actually viewing the front-end. Can someone point me to further documentation covering displaying the front end?

@ainsleys is this the right place to suggest that a modification to the Part 3 tutorial to add a bit about running the dapp for the front-end?

I also gave him the instructions to install and launch the dApp.

Review enigma bounty projects to make sure they work with discovery version 0.1.8

Discord:
@nex pointed out that the enigma-millionaires-problem repo was generating an error on discovery test.

https://github.com/lauraweindorf/enigma-millionaires-problem

There were a couple of changes since the last version the repo was using (0.1.3) so I updated truffle.js and a few package dependencies and committed. It's working now.

I thought I'd add an issue here because some or all of the Enigma bounty dApps may have the same issue and will need to be updated to get them working with the latest 0.1.8 discovery version.

cc @levackt @ainsleys @lacabra

Does it mean that the contract code remains secret unless someone publishes it offchain?

This is a question from Codonyat on discord.

He asks:

"A hash of the Secret contract is sent to the Enigma Contract on Ethereum"
Does it mean that the contract code remains secret unless someone publishes it offchain?

MrGarbonzo Today at 8:41 AM
Codonyat it's my understanding the secret contract code is public. This is done to insure no malicious code is sent to the nodes. I can't find a quote from the team for you tho.
Maybe Ainsley | Enigma can clarify?

Codonyat Today at 2:26 PM
Ok, but where is it stored?

I'll review the architecture and code to see if I can definitively answer.

In the meantime if you guys know, feel free to answer here or in discord (@levackt, @ainsleys, @lacabra).

I believe the encrypted content of the secret contract in terms of the logic for a compute task is stored in the Enigma contract on-chain, with the interface spec being public and unencrypted. One of the key benefits of Salad, if I remember correctly, was that the logic for triggering the basket "shuffling" is secret and can't be public otherwise the basket mixing algorithm would be revealed and there'd be no value to a crypto coin mixing fund?

Dev following millionaire's tutorial is getting error that task key pair needs to be set

From the forum:
https://forum.enigma.co/t/error-when-running-discovery-test-for-tutorial-millionaires-problem/1130

Dev is following the blog post Getting Started with Enigma: An Intro to Secret Contracts.

The error is Error: Need to set task key pair first.

I told him to add the enigma.setTaskKeyPair('cupcake') call to the test JS.

The tutorial code for test/test_millionaires_problem.js in the blog post needs to be updated to include setting the task key pair.

cc @ainsleys @lacabra

Questions on internals of Enigma Protocol

ARsakura is asking for some information on the internal implementation and concepts of the Enigma Protocol from these papers:

cc: @ainsleys @lacabra

Is there any discussion of these concepts under the Enigma documentation?

I want to ask some questions about the paper ,

Decentralizing Privacy: Using Blockchain to Protect Personal Data

In this paper , it refer the Tdata , Taccess can store some information and send in blockchain.

I wonder the Tdata , Taccess , they both are transaction , but are they also smart contract?

Enigma: Decentralized Computation Platform with Guaranteed Privacy

In this paper , I wonder when share be generate? I know encrypted data & public data , but what cause share be generated?

data --(by policy encrypt)–> encrypted data --( what party in share? )

–> share --(for privacy)–> spdz (verified correct)

and , is share step equal the secret smart contract ? or spdz step.

Smart contract and secret contract

forum post

After running the demo Millionaire, I am a bit of confused about the difference between smart contract and secret contract.

I understand the secret contract is mainly designed to handle the dapp logic(in the Millionaire demo are how to add_millionaire and compute_richest).

But what’s the function of the smart contract (i.e. Sample.sol and Migrations.sol) ? 🤔

Stan is mostly following Laura's millionaires project, he mentions a Sample contract so I guess he also ran init in this or a new project.

Can and Ainsley have responded but we should also cleanup any unused smart contract code in the project.
We can also refer to the non-fungible token project for example smart + secret contract usage.

Streaming data, and making http requests

This one's from discord, from user Moskalyk, one of the waterloo hackers.

Curious, if I was wanting to perform stream processing with rust, is there any reason why enigma secret contracts wouldn't be able to support this abstraction?
Similarly, performing HTTP GET requests (or any other typical rust function) within a secret contract should be okay?

On the 1st question, I've referred to the discussion on Large scale data architecture, the entire state is fully encrypted.

The 2nd I don't believe to be possible in the enclave, and referred to the FAQ about Oracles;

How do I get oracle data into a computation?
We currently do not support TLS or HTTP requests within a computation. We suggest that developers utilize a relayer model where applicable to obtain and submit this type of data.

I also believe if the library, any http in this case, uses any features not supported by the SGX environment it will fail to run.

Not sure if this is 100% correct and covers it, or maybe we can have further clarity in the FAQ or a blog on which features are supported and what's restricted by SGX.

test issue

testing issue for integration with airtable

Error migrating millionaires problem secret contract

From @masternodes on Discord:

I've followed this entire guide: https://blog.enigma.co/getting-started-with-enigma-a-front-end-demo-for-dapps-bc694d3d81b9 and I am able to run discovery start and compile the millionare contract but when I launch my react app it just says: "Millionaires' Problem secret contract not yet deployed..."
It's making the connection to the local dev enviornment, but it won't connect to the contract
node v10.16.3
discovery-cli v0.1.3


Error on discovery migrate

Macs-Air:enigma mac$ discovery migrate (node:49865) UnhandledPromiseRejectionWarning: Error: SyntaxError: await is only valid in async function     at Object.run (/Users/mac/.npm-global/lib/node_modules/@enigmampc/discovery-cli/node_modules/@truffle/migrate/index.js:96:13)     at process._tickCallback (internal/process/next_tick.js:68:7) (node:49865) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:49865) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I'm going to fork his repo and see if I can get it working for him.

Error when Installing

forum post

Looks like the node permissions issue, referred him to previous solutions and suggested nvm.
Leaving this open for confirmation.

initializing enigma

New user stan_yi is stuck on init, I suspect it's the issue with taskkey and I've requested some more info or source code.

forum posts here and here

Any way to privately obtain blockchain data from within a secret contract?

forum post

i.e. call a function in a secret contract that does an ethereum address balance query, without the host running the TEE being able to monitor what address was queried.

Bonus if the response can be signed with an enclave’s embedded private key.

Answer from discord: (@ainsleys )
'We don’t currently natively support TLS connections right now, but there are a few options to work around. Currently you could use a trusted oracle of some kind to submit the required data as a > Task, and have the secret contract return that data so that it can be verified as correct by the smart contract upon completion.

This is a good question for the forum-- if you raise it there, we can give a more in-depth discussion.’

Is ML model training actually possible on Enigma? How?

forum question

ML learning requires HUGE DATASETS in order of Terrabytes.

I saw DIDI’s cab data around 3TB somewhere on the web, if I am to train a self driving car model using data from Tesla, GM, Uber, BMW. How would I process these many TB of data on the blockchain?

How would the training take place? Could anyone please delineate as to how it will happen? (step by step that is…)

On the Discord I saw that current SGX limitation is 4gb, how would training happen if the raw data is in TBs ?

"Allowance not enough" error thrown

This issue also reported by Peter, working on Rock paper scissors implementation. I can ask for more details if anyone has a suggestion for what would help get this issue resolved.

How do I get oracle data into a computation?

forum question

The docs state:

We currently do not support TLS or HTTP requests within a computation. We suggest that developers utilize a relayer model where applicable to obtain and submit this type of data.

Could this be elaborated upon? Are you referring to a 0x-style relayer? These typically use HTTP or encrypted WebSockets (TLS).
Could I use ZeroMQ?
Could I use unencrypted WebSockets (and handle encryption myself)?

No API code evident?

forum post

Hi there I have been scanning through the enigma github and see it doesnt expose an api yet? (obviously because of no network up yet)
Is this planned?
I’d like to query the following:
workerAddress, Latest block, block hash, timestamp, status (Failed/Success)

I know there's a network explorer being worked on, which means the api he's after will be up and possibly on discovery-documentation. Was touched on in the community call so I'll only mention that, please weigh in with more info if needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.