zkdoc_sdk

Crates.iozkdoc_sdk
lib.rszkdoc_sdk
version0.0.1
sourcesrc
created_at2023-02-09 08:47:32.677957
updated_at2023-02-09 13:23:34.271221
descriptionSDK for zkdoc allowing plug and play with any application
homepage
repositoryhttps://github.com/medi-0/core/tree/main/zkdoc_sdk
max_upload_size
id780595
size112,933
Chen Wen Kang (cwkang1998)

documentation

README

zkdoc_sdk

Usage

First, add it with cargo like so:

cargo add zkdoc_sdk

Now, you can start using it!

use zkdoc_sdk::services::services::{
    generate_proof, get_file_commitment_and_selected_row, get_selected_row, verify_correct_selector,
};

fn main() {
  // Generate a commitment, and save it somewhere for verification later
  let commitment = get_file_commitment_and_selected_row(
    row_titles.to_owned(),
    row_contents.to_owned(),
    row_selectors.to_owned(),
  );

  // Generate proofs here
  let proof = generate_proof(
      row_titles.to_owned(),
      row_contents.to_owned(),
      row_selectors.to_owned(),
  );

  // Verify proofs like so
  let row_accumulator = get_selected_row(row_title.to_owned(), row_content.to_owned());
  let is_valid = verify_correct_selector(
      commitment,
      row_accumulator,
      proof,
  );

}

API documentation

The full api docs is available at doc.rs.

Commit count: 0

cargo fmt