-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cryptex milestone 2 #985
cryptex milestone 2 #985
Conversation
@driemworks thank you for the milestone delivery. Please see the evaluation document and provide proper answers and fixes. Let me know when I can continue this evaluation. |
@dsm-w3f thanks for the quick feedback! I've resolved all the issues in the evaluation document. To summarize:
|
@driemworks thank you for the answers and fixes. I tried again and I still have some doubts and problems. Please see the evaluation document. Let me know when I can continue the evaluation. |
|
@driemworks thank you for the improvements and fixes. I was able to test more parts locally but not all the system. Please see the evaluation document for details. Let me know when I can continue this evaluation. |
There are basically two ways to run everything:
The first way is what exists in the etf.js/examples app, which syncs with the etf0 bootnode. For the second approach, where you want to use a locally running node instead of a smoldot light client, you'd have to make the change like in my last comment (replace lines 25 and 26 here ). You won't be able to connect the smoldot client with a locally running full node I believe (correct me if wrong, but smoldot doesn't support insecure connections so it's possible but you'd need to set up a secure connection between local full node and smoldot). I attempted previously by updating the chainspec to point to a locally running bootnode but receive You could run the full node a couple of ways, either as its own validator on its own chain, starting at block zero, or else get the chainspec here to sync with the etf0 bootnode. If you connect with the light client right now it might take a minute or two to sync. If you're available for a call we can probably clear everything up. |
@driemworks thank you for the answer. I tried to test it again locally using Smoldot and didn't work, but as worked with the full node, I think maybe there is some detail that I'm missing. Please see the evaluation document for details. I also noticed that the evaluation branch was not updated with some changes that I need to make to run the code, for example, the merge conflicts in the code. I expect that the user could just follow the instructions in the Readme files and run the application. Please make sure that the documentation and code incorporate the changes needed to allow that. There is no need for a meeting, the documentation should be enough to run the system. Also pinging @burdges, to see if he could take a look at the cryptography part of this milestone delivery since he was actively involved in the discussions of the grant application. |
You don't need to do this actually, etf.js starts the light client in the browser. You should be able to just pull the latest main branch and run the example following the readme. There was a problem with the event emitter's visibility that is resolved that was preventing the latest slot from being dispatched to the react app. I removed the /dist folder from git, since it should be built from the root directory anyway (using |
@driemworks thank you for the answer. I tried and the main branch is more stable than the other one passed before. For now, I will wait for feedback of the research team regarding the cryptography part. This could take one or two weeks to complete. |
@dsm-w3f sounds good. I'm available via matrix as well (@driemworks:matrix.io) to provide any further context regarding the cryptography aspects of the codebase (which somewhat fall out of the scope of the testing docs we provided). |
It sounds like you've a bigger vec than you'd like? https://github.com/ideal-lab5/etf-sdk/blob/main/crypto/src/ibe/fullident.rs#L20 I've now forgotten exactly what you wanted to do, but assuming you wanted a threshold scheme, then you can have the user do Lagrange interpolation between the It's likely all fine, but please do feel free to ask about optimizing the size. |
That was related to the logic here, but I think it's ok. The function uses a threshold scheme to generate an AES key, and then encrypts the shares using IBE, and later on the decrypt function decrypts the shares (assuming slot secrets are available) and uses lagrange interpolation here to recover the AES key. My comment was more about a concern that the size of the resulting ciphertext could get really big if they want to choose a larger number of slots to encrypt to, but I think that's probably more of an application issue than implementation problem (i.e. if you only have X storage available, only use Y slots). It would be ideal if somehow the IBE ciphertexts could be aggregated but that's probably out of scope for us (for now at least). I think my biggest concern is our DLEQ impl. You had previously mentioned using the dleq_vrf crate to do it, but we implemented it with arkworks instead. The current setup uses onchain randomness to seed an RNG when creating the proof. Would the dleq_vrf approach be more efficient? |
It's likely fine.. You do need an "IBE encryption" per future block the user selects, but you could think if them not so much as encryptions but as key exchanges. Set In your ciphertext, you need the I guess I didn't notice these MACs but maybe you've them in your encryption somehow. |
Thanks! That seems much more optimal. Instead of performing IBE encryption ala FullIdent, we just perform this key exchange and don't need to store/transport the larger IBE ciphertexts. There is no MAC currently, it just ignores invalid keys right now. We'll plan to make both of these alterations in the next milestone. |
It's likely FullIdent contains a MAC of some sort, not sure. You're almost still performing one "encryption" per upcoming block, well the MACs can be thought of as an AEAD of the empty message, but MACs only require 16 bytes each. It's the It's likely fine if f is only 128 bits, because what would collision attacks achieve? That's not a proof though, just a guess. |
The decryption function uses the first param of the ciphertext to authenticate (checks if U == rP, in G2) so sort of a MAC, but it's 96 bytes per ciphertext and each ciphertext ends up being 160 bytes (using sha256), so it's larger than the above for n > 2 as long as k is large enough? |
@dsm-w3f when do you think we can proceed? We intend to implement the optimizations discussed as part of the next milestone, since it will require further research, implementation and testing, and the current implementation seems to be working correctly (though not optimally). |
@driemworks thank you for the answers and @burdges thanks for the review. I agree that these optimizations can be handled later. The milestone is approved. I'll forward your invoice internally and the payment should take place within two weeks. Great job! |
Milestone Delivery Checklist
Link to the application pull request: w3f/Grants-Program#1660