Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
7a2822f
Add build script in `mithril-aggregator-fake`
Feb 14, 2024
5ee86bd
Extract directly artifact id from filename when reading files
Feb 15, 2024
f244890
Implement generation of artifact getter
Feb 15, 2024
bc0c810
Add `epoch-settings` in import script & generated code
Feb 15, 2024
872d832
Supersede `default_values` content buildscript generated code
Feb 15, 2024
5b1742f
Add `ctx_commitment` and adapt `epoch-settings` in shared_state
Feb 15, 2024
e1d8b54
Generate ids array for testing
Feb 15, 2024
9ada2bb
Adapt `mithril-aggregator-fake` tests with generated data
Feb 15, 2024
08dd5ad
Wire Cardano transactions commitments and add tests
Feb 15, 2024
7f504e1
Add `transfer_funds` to run-only scenario in E2E
Feb 15, 2024
53122d0
Add `download_ctx_proof` to fake-aggregator import script
Feb 15, 2024
c5f70c9
Add ctx-proof to buildscript generated default values
Feb 15, 2024
36e6ec6
Add route `/proof/cardano-transaction` to fake aggregator
Feb 15, 2024
6fc30f1
Fix collision with list when reading individual files and cleanup cre…
Feb 15, 2024
e3abce5
Extract generations methods in fake aggregator build script to a dedi…
Feb 16, 2024
5a1e622
Add capability to only generate code for 'ids' for mithril-build-scri…
Feb 16, 2024
06b62b7
`client_wasm` tests now use autogenerated test data from fake aggrega…
Feb 14, 2024
24187ce
Fetch missing certificate when downloading artifact & ctx proof using…
Feb 16, 2024
453ba89
Add `get_cardano_transaction_proofs` & `compute_cardano_transaction_p…
Feb 16, 2024
1bd233b
Add Cardano transactions functionnalities in `www/`
Feb 19, 2024
054b019
Add Cardano transactions functionnalities in `www-test/`
Feb 19, 2024
21ae072
Update `mithril-client-wasm` README
Feb 19, 2024
846b183
Update `mithril-client-wasm` developer documentation
Feb 19, 2024
673b88a
Rename 'transaction_set' into 'transaction_commitment'
Feb 19, 2024
0759f89
Remove `default_data/` from fake aggregator .gitignore
Feb 19, 2024
bc1ad9c
Enhance `import.sh` script of `mithril-aggregator-fake` with `jq`
Feb 20, 2024
06d3dd9
Update `default_data/` content after enhancement of the script
Feb 20, 2024
b1299a3
Fix comments to update them
Feb 20, 2024
ee35032
fix: rename function and typos after review
Feb 21, 2024
4ffb3c9
docs: enhance wasm library developer guide
Feb 21, 2024
293cb94
docs: add description & README.md to `mithril-build-script` crate
Feb 21, 2024
f93058a
chore: update crates version
Feb 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ on:
required: false
type: string
default: https://raw.githubusercontent.com/input-output-hk/mithril/main/mithril-infra/configuration/pre-release-preview/genesis.vkey
transactions_hashes_to_certify:
description: Comma separated list of transactions hashes to test certification on.
required: false
type: string
enable_debug:
description: Enable debug output ("-vvv") for the mithril-client calls
required: true
Expand Down Expand Up @@ -193,6 +197,7 @@ jobs:
run: |
echo "AGGREGATOR_ENDPOINT=${{ inputs.aggregator_endpoint }}" > ./www-test/.env
echo "GENESIS_VERIFICATION_KEY=$(curl -s ${{ inputs.genesis_verification_key }})" >> ./www-test/.env
echo "TRANSACTIONS_HASHES_TO_CERTIFY=${{ inputs.transactions_hashes_to_certify }}" >> ./www-test/.env

- name: Start the server
working-directory: mithril-client-wasm
Expand Down
18 changes: 13 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"examples/client-mithril-stake-distribution",
"examples/client-snapshot",
"mithril-aggregator",
"mithril-build-script",
"mithril-client",
"mithril-client-cli",
"mithril-client-wasm",
Expand Down
6 changes: 6 additions & 0 deletions docs/website/root/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ A Cardano node is a node that runs in a [Cardano network](#cardano-network). The

A Cardano key pair is an asymmetric key pair used to identify a [stake pool operator](#stake-pool-operator-spo) on the [Cardano network](#cardano-network).

## Cardano transaction

A Cardano transaction proof is a cryptographic proof that a sub-set of Cardano transactions is included in the Cardano transactions set. It is generated upon request from a [Mithril client](#mithril-client) and is signed by a [certificate](#certificate).

A Cardano transactions set commitment represents, in a succinct way, the Cardano transactions set that was signed by Mithril at a given [Beacon](#beacon).

## Certificate

The Mithril aggregator combines the produced [multi-signature](#multi-signature) and some metadata into a Mithril certificate that will be later used by the [Mithril client](#mithril-client) to verify the authenticity of a [snapshot](#snapshot). The certificates are chained so that the [stake distribution](#stake-distribution) used to create the signatures is verifiably genuine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Mithril client library WASM can be used by Javascript developers to use the Mith
It is responsible for handling the different types of data certified by Mithril, and available through a Mithril aggregator:
- [**Snapshot**](../../../glossary.md#snapshot): list and get.
- [**Mithril stake distribution**](../../../glossary.md#stake-distribution): list and get.
- [**Cardano transaction**](../../../glossary.md#cardano-transaction): list & get commitments, get proofs
- [**Certificate**](../../../glossary.md#certificate): list, get, and chain validation.

:::
Expand Down Expand Up @@ -113,6 +114,36 @@ let valid_stake_distribution_message = await client.verify_message_match_certifi
console.log("valid_stake_distribution_message:", valid_stake_distribution_message);
```

If the aggregator signs **CardanoTransactions**, you can add the code below to the previous example:

:::tip

You can verify that the aggregator signs **CardanoTransactions** by running the command below:

```bash
wget -q -O - YOUR_AGGREGATOR_ENDPOINT | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])'
```

For example with the aggregator on `testing-sanchonet` Mithril network:

```bash
wget -q -O - https://aggregator.testing-sanchonet.api.mithril.network/aggregator | jq '.capabilities.signed_entity_types | contains(["CardanoTransactions"])'
```

:::

```js
const proof = await client.unstable.get_cardano_transaction_proofs(["CARDANO_TRANSACTION_HASH_1", "CARDANO_TRANSACTION_HASH_2"]);
console.log("Proof tx hash", proof.transactions_hashes);
console.log("Proof certificate hash", proof.certificate_hash);

let proof_certificate = await client.verify_certificate_chain(proof.certificate_hash);
console.log("verify_certificate_chain OK, last_certificate_from_chain:", proof_certificate);

let valid_cardano_transaction_proof = await client.unstable.verify_cardano_transaction_proof_then_compute_message(proof, proof_certificate);
console.log("valid_cardano_transaction_proof:", valid_cardano_transaction_proof);
```

:::tip

You can read the complete [Rust developer documentation](https://mithril.network/rust-doc/mithril_client_wasm/index.html).
Expand Down
3 changes: 3 additions & 0 deletions mithril-build-script/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target/
.DS_Store

11 changes: 11 additions & 0 deletions mithril-build-script/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "mithril-build-script"
version = "0.1.0"
description = "A toolbox for Mithril crates build scripts"
authors = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
repository = { workspace = true }

[dependencies]
5 changes: 5 additions & 0 deletions mithril-build-script/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Mithril-build-script

A toolbox for Mithril crates that need a [build scripts phase](https://doc.rust-lang.org/cargo/reference/build-scripts.html).

Moreover, this crate allows to test the build scripts, which is not supported directly in `build.rs` (see: [rust-lang/cargo#1581](https://github.com/rust-lang/cargo/issues/1581)).
Loading