From 384134992d86d3c9f7afcd1f85ff0c5decdd9c31 Mon Sep 17 00:00:00 2001 From: Augusto Hack Date: Mon, 4 Mar 2024 21:00:03 +0100 Subject: [PATCH] miden-tx: add readme (#503) --- miden-tx/README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 miden-tx/README.md diff --git a/miden-tx/README.md b/miden-tx/README.md new file mode 100644 index 000000000..9646f2962 --- /dev/null +++ b/miden-tx/README.md @@ -0,0 +1,49 @@ +# Miden Transaction + +This crate contains tools to create, execute, and prove transactions. + +## Usage + +This crate exposes a few components to compile, run, and prove transactions. + +The first requirement is to have a `DataStore` implementation. `DataStore` +objects are responsible to load the data needed by the transactions executor, +specially the account's code, the reference block data, and the note's inputs. + +```rust +let store = DataStore:new(); +``` + +Once a store is available, a `TransactionExecutor` object can be used to +execute a transaction. Consuming a zero or more notes, and possibly calling +some of the account's code. + +```rust +let executor = TransactionExecutor::new(store); +let executed_transaction = executor.execute_transaction(account_id, block_ref, note_ids, tx_args); +``` + +With the transaction execution done, it is then possible to create a proof: + +```rust +let prover = TransactionProver::new(ProvingOptions::default()); +let proven_transaction = prover.prove_transaction(executed_transaction); +``` + +And to verify a proof: + +```rust +let verifier = TransactionVerifier::new(SECURITY_LEVEL); +verifier.verify(proven_transaction); +``` + +## Features + +| Features | Description | +| ------------ | --------------------------------------------------------------------------------------------- | +| `std` | Enable usage of Rust's `std`, use `--no-default-features` for `no-std` support. | +| `concurrent` | Enables concurrent code to speed up runtime execution. | + +## License + +This project is [MIT licensed](../LICENSE).