Skip to content
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

Put the asset info in the CSV header #183 #192

Conversation

alxkzmn
Copy link
Contributor

@alxkzmn alxkzmn commented Nov 24, 2023

Resolves #183.

@alxkzmn
Copy link
Contributor Author

alxkzmn commented Nov 24, 2023

@enricobottazzi @sifnoc we'll also need to modify the CSVs used for benchmarks after this one is merged.

Copy link
Member

@enricobottazzi enricobottazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks fine. I just have some issue with the naming of this new field on MerkleSumTree as assets. While this is technically correct. it sounds confusing in the context of Proof of Solvency, as people associate assets with proof of assets, which is not the case here.

In our context Asset can be replaced by Currency, CryptoCurrency or Coin. Open to suggestion

- `assets.csv`: Calculates the total balance of assets for the solvency proof. Only the CEX can generate this file.
- `entry_16.csv`: Used to build the Merkle sum tree, with each leaf element derived from sixteen entries in the CSV.
- `ptau/hermez-raw-11`: Contains parameters for constructing the zk circuits.
- `entry_16.csv`: contains the username and asset balance entries for each CEX user (necessary to build the commitment). Asset balance column names have the following format: `balance_<ASSET>_<CHAIN>`, where <ASSET> and <CHAIN> are the names of the assets and their corresponding blockchains. <CHAIN> values are the same as in the Address Ownership Proof step;
Copy link
Member

@enricobottazzi enricobottazzi Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it confusing to name it asset balance entries when these are actually liabilities.

@@ -1,6 +1,7 @@
use crate::merkle_sum_tree::{Entry, MerkleProof, Node};
use halo2_proofs::halo2curves::bn256::Fr as Fp;
use num_bigint::BigUint;

use super::Asset;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use use crate::merkle_sum_tree::Asset rather than super ? Just for coherence with the rest of the library

@@ -22,6 +22,7 @@ pub struct MerkleSumTree<const N_ASSETS: usize, const N_BYTES: usize> {
nodes: Vec<Vec<Node<N_ASSETS>>>,
depth: usize,
entries: Vec<Entry<N_ASSETS>>,
assets: Vec<Asset>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming is confusing

enricobottazzi

This comment was marked as duplicate.

@alxkzmn
Copy link
Contributor Author

alxkzmn commented Nov 27, 2023

@enricobottazzi How about "cryptoasset"?

Copy link
Member

@enricobottazzi enricobottazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LFG!

@enricobottazzi enricobottazzi merged commit 2bb8bff into summa-dev:v1-improvements-and-consolidation Nov 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants