scrtlabs / dev-help Goto Github PK
View Code? Open in Web Editor NEWThis repository is for opening and managing developer issues
This repository is for opening and managing developer issues
https://forum.enigma.co/t/edit-ganache-cli-launch-parameters-enigma-contract-docker-image/1021/4
This is a follow-up to the user's last question.
I've responded, but the user may have additional questions. The user also requested a tutorial, which we should definitely consider providing asap if we can.
Errors occur since name of the folder “rust_millionaires_problem” and the name in Cargo.toml “rust_millionaires_demo” are not matching.
https://forum.enigma.co/t/millionaires-problem-medium-tutorial-needs-editing/1067
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
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
runnpm audit fix
to fix them, ornpm 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.
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:
discovery-cli
can also use the template.env
pattern.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.
Traditional bounties / Contest bounties
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)
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
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?
From Discord:
(sepia 10/04/2019)
Is there an updated version of the millionaires problem SC with the latest improvements?
mean the ones described in the blogpost above, "secret-contracts-now-new-and-improved"
I thought it would be helpful to have a direct comparison of the syntax with the millionaires problem
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!
Several users (in this case, Nionis) have asked if it is currently possible to enable a way for secret contracts to verify the ethereum address of a task sender.
This error is reported by Peter, who was working on rock paper scissors bounty.
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.
@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?
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.
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.
Is the input size of a task or a contract limited to 1MB?
is it possible to include an external crate with more than 1MB?
https://forum.enigma.co/t/data-input-size-limit-increase-1mb/1092
User is rewriting SimpleMultisig contract into Rust https://github.com/christianlundkvist/simple-multisig/blob/master/contracts/SimpleMultiSig.sol to be executed on Enigma.
User question originates on Discord, #dev-help channel... handle is AndreiIV#3048
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.
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.
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);
}
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?
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
I believe @lacabra is familiar with what might be causing this issue
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?
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 forcore::result::Result<(), Error>
So how should potential errors and known failure conditions be handled in Enigma secret contracts?
From user:
I want to use an extern crate in my SC (~200kb) which has dependencies around 2MB of which some are used in the Enigma protocol (e.g. libc, failure).
https://forum.enigma.co/t/data-input-size-limit-increase-1mb/1092/2
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?
Question from @stan_yi on dev forum: https://forum.enigma.co/t/browser-stucked-at-connecting-to-the-salad-server/1212/2
Issue added to salad
: scrtlabs/salad#41
I've encountered the same. I've opened an issue here as well to track.
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.
Question from @nionis -- nionis/enigma-benchmarking#2
He wants to understand:
if there is a place where we can find the secret contract address other than the one within tests.
Currently it feels a bit hacky but acceptable I suppose for mainnet since the address doesn't change.
One more bounty to run and check to see if--
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.
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?
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.
ARsakura is asking for some information on the internal implementation and concepts of the Enigma Protocol from these papers:
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.
Nionis has finished the code for secret benchmarking, could someone take a look and see if they're able to run it locally, can follow the instructions easily, or notice any other issues?
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.
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.
testing issue for integration with airtable
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.
Looks like the node permissions issue, referred him to previous solutions and suggested nvm.
Leaving this open for confirmation.
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.’
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 ?
https://forum.enigma.co/t/edit-ganache-cli-launch-parameters-enigma-contract-docker-image/1021
joao.l.martins would like to provide his own mnemonic key, ideally without building an image.
He's built a custom image in the meantime but couldn't run it.
There's also a follow up question, how secret contracts call smart contracts with computation results.
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.
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)?
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.
Here's the link --
this is one of our bounty devs, and he's run into quite a lot of trouble. It will be great if we can help get this resolved.
https://forum.enigma.co/t/problem-with-decrypttaskresult-only-in-react-app/1106
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.