ink-quill 0.1.0

Another transcript library
Documentation
  • Coverage
  • 75%
    9 out of 12 items documented2 out of 10 items with examples
  • Size
  • Source code size: 25.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 139.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • qti3e

ink-quill

Inspired by Random Oracle, The ink-quill library is a Rust package for efficient and reliable transcript construction. The library provides an efficient way to group various pieces of information, making it easier for verification, storage, or exchange of data.

Usage

[dependencies]
ink-quill = "0.1.0"

TranscriptBuilder

Here's an example of how to create a transcript and add data to it:

use ink_quill::{TranscriptBuilder, TranscriptBuilderInput};

async fn main() {
    let mut builder = TranscriptBuilder::empty("example domain");
    builder = builder.with("nonce", &0)
        .with("transaction", &"deposit")
        .with_prefix("amount".to_string())
        .with("value", &1000_u64)
        compile();
}

TranscriptBuilderInput

For your own data types, you can implement the TranscriptBuilderInput trait:


struct MyData {
    pub value: u64,
}

impl TranscriptBuilderInput for MyData {
    const TYPE: &'static str = "MyData";

    fn to_transcript_builder_input(&self) -> Vec<u8> {
        self.value.to_be_bytes().to_vec()
    }
}

Contributing

Contributions to ink_quill are welcomed. Please make sure to run the test suite before opening a pull request

License

MIT APACHE 2.0