pub fn readme_content(package_name: &str, account_address: &str) -> String {
format!(
r#"# {package_name}
## What it does
This package contains an Aptos Move Groth16 verifier generated from checked Groth16 artifacts.
It was generated by `export-aptos-verifier` and performs strict field validation and local proof verification before generating Move code.
The generated verifier code is not audited. Use at your own risk.
## Supported curves
- BN254 / bn128
- BLS12-381 / bls12-381
## Installation
Build the package from sources and run `export-aptos-verifier`.
## CLI usage
Use the `generate` subcommand with:
- `--vk`
- `--proof`
- `--public` when public inputs are stored separately
- or `--bundle` for compact one-file artifacts
- `--out`
- `--package-name`
- `--module-name`
- `--account-address`
By default BN254 uses uncompressed points and `entry` mode.
## BN254 format
- G1: uncompressed
- G2: uncompressed
- Fr: little-endian 32 bytes
## BLS12-381 format
- G1: compressed
- G2: compressed
- Fr: little-endian 32 bytes
## Security notes
- strict field bound checking (`value < modulus`) is enforced before conversion
- subgroup and curve membership checks are performed
- point conversion normalizes from Jacobian/projective coordinates when needed
## Examples
See the repository examples for `MulCircuit` and `ark-mimc`.
## Known limitations
- Prepared verification mode is not implemented in this version (`--prepared` returns ERR_PREPARED_NOT_IMPLEMENTED).
- This tool does not verify cryptographic assumptions beyond local Arkworks checks.
Account: {account_address}
"#,
package_name = package_name,
account_address = account_address
)
}
pub fn vector_of_hex(values: &[String]) -> String {
if values.is_empty() {
return "vector[]".to_string();
}
let body = values
.iter()
.map(|value| format!(" {value},"))
.collect::<Vec<_>>()
.join("\n");
format!("vector[\n{body}\n ]")
}