zkbob / libzeropool-zkbob Goto Github PK
View Code? Open in Web Editor NEWThis project forked from zeropoolnetwork/libzeropool
License: Apache License 2.0
This project forked from zeropoolnetwork/libzeropool
License: Apache License 2.0
timestamp
- public input to the snark contractrequire(timestamp <= block.timestamp && timestamp >= block.timestamp - 30 minutes)
. This way, each transaction would have at most 30 minutes to be mined (we already have time-bounded limit in the permit deadline, so not a problem at all)account.last_action_time
- time of last action associated with the accounttimestamp > account.last_action_time
and assigns account.last_action_time
to timestamp
account.today_turnover_used
- sum of all deposits/withdrawals/transfers made today (see https://github.com/zkBob/zkbob-contracts/blob/e69787ef994518a37939b3539dbd62fb701a0dc0/src/zkbob/utils/ZkBobAccounting.sol#L182-L193 for logic reference)Below is the profile for single-threaded synchronization of the user on the production environment.
Using it, we can determine which type of work consumes the majority of the synchronization time. It is evident that the majority of time is spent performing elliptic curve scalar multiplication within these four functions.
We already have the issue that aims to drastically reduce the amount of time spent within functions 2 and 4. In theory, this proposal has the potential to entirely eliminate the time spent within functions 3 and 4. Unfortunately, this approach can only be implemented for future transactions.
Within the decrypt_in
function, we attempt to identify notes that belong to us using the following method:
In the decrypt_out
function, we are trying to decrypt the account and the notes by decrypting
In the first case, we must perform ECDH between the sender and the receiver to exchange the common key. However, in the second scenario, we actually perform ECDH between the sender and themselves. What we actually need to do is to encrypt
Here is a simple proposal for encrypting and decrypting
We need to derive a symmetric key
By using this scheme, we can bypass slow operations and utilize only symmetric encryption.
Since we are using a random nonce, we must ensure that the probability of collision is negligible. chacha20-poly1305
uses a 96-bit nonce, enabling us to encrypt approximately xchacha20-poly1305
instead, as it employs a 192-bit nonce. By using xchacha20-poly1305
, we can encrypt up to
This protocol update appears relatively straightforward, with the only non-obvious aspect being the memo versioning. It seems to me that there are three potential methods for determining which decryption approach to use during synchronization:
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.