Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add ashlang adapter doc #259

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 43 additions & 0 deletions docs/docs/adapters/ashlang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Ashlang Adapter

Mopro supports the integration of [Ashlang](https://github.com/chancehudson/ashlang) circuits. Ashlang is a scripting language for expressing mathematical relations between scalars and vectors in a finite field. It supports proving on the following systems:

- [tritonvm/triton-vm](https://github.com/tritonvm/triton-vm): using `tasm` target in this crate
- [microsoft/spartan](https://github.com/microsoft/spartan): using `ar1cs` target in [chancehudson/ashlang-spartan](https://github.com/chancehudson/ashlang-spartan)

## Setup the rust project

You can follow the instructions in the [Rust Setup](/setup/rust-setup.md) guide to create a new Rust project that builds this library with Ashlang proofs.

In your `Cargo.toml` file, ensure the `ashlang` feature is activated for `mopro-ffi`:

```toml
[features]
default = ["mopro-ffi/ashlang"]
```

:::warning
**Note:** The current Ashlang adapter only supports the Spartan prover.
:::

<!-- TODO: how to compile circuits -->

## Using the Library

After you have specified the circuits you want to use, you can follow the usual steps to build the library and use it in your project.

### iOS API

The Ashlang adapter exposes the following functions to be used in the iOS project:

```swift
// Generate a proof for a given circuit ar1cs, as well as the circuit inputs
generateAshlangSpartanProof(ar1csPath: ar1csPath, inputs: inputs) -> GenerateProofResult

// Verify a proof for a given circuit ar1cs
verifyAshlangSpartanProof(ar1csPath: ar1csPath, proof: generateProofResult.proof) -> Bool
```

### Android API

The Ashlang adapter exposes the equivalent functions and types to be used in the Android project.
1 change: 1 addition & 0 deletions docs/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const sidebars: SidebarsConfig = {
'adapters/overview',
'adapters/circom',
'adapters/halo2',
'adapters/ashlang',
]
},
{
Expand Down
Loading