Comments (1)
Implementation
Add new package leo-verify
so that all verification is isolated from other parts of Leo.
After parsing the state file, pass all values into leo-verify
. Generate the record commitment and verify then generate the local data commitment and verify.
Example State file:
[[public]]
[state]
leaf_index: u32 = 0;
root: u8[32] = [0u8; 32];
[[private]]
[record]
serial_number: u8[32] = [0u8; 32];
commitment: u8[32] = [0u8; 32];
owner: address = aleo1qnr4dkkvkgfqph0vzc3y6z2eu975wnpz2925ntjccd5cfqxtyu8sta57j8;
value: u64 = 5;
payload: u8[32] = [0u8; 32];
birth_program_id: u8[32] = [0u8; 32];
death_program_id: u8[32] = [0u8; 32];
serial_number_nonce: u8[32] = [0u8; 32];
commitment_randomness: u8[32] = [0u8; 32];
[state_leaf]
path: u8[32][2] = [ [0u8; 32], [0u8; 32] ];
memo: u8[32] = [0u8; 32];
network_id: u8 = 0;
leaf_randomness: u8[32] = [0u8; 32];
Verify record commitment
let commitment = Commit(
record.owner,
record.value,
record.payload,
false, // set is_dummy to false
record.birth_program_id,
record.death_program_id,
record.serial_number_nonce,
record.commitment_randomness,
);
record.commitment == commitment
Verify local data root
let local_data_root = MerklePath(
state.leaf_index,
commitment,
state_leaf.memo,
state_leaf.network_id,
state_leaf.leaf_randomness,
state_leaf.path
)
state.root == local_data_root
from leo.
Related Issues (20)
- [Docs] the part of the name after the hyphen
- [Docs] add to the list of contributors
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Docs] the part of the name after the hyphen
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Docs] List of contributors
- [Docs] List of contributors
- [Docs] The part of the name after the hyphen
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Docs] add to the list of contributors
- [Docs] the list of contributors
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Bug] Leo cli fails on an execute with "Failed to parse input #0" HOT 9
- Applying for this position as a Rust developer! HOT 1
- internal compiler error HOT 6
- internal compiler error HOT 7
- [Docs] The badge request processing script truncates the part of the name after the hyphen
- [Bug] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leo.