wave-squareAlphaHive On-Chain Signatures Verification in Move

Move contracts in AlphaHive support verifications for several signature schemes on-chain. Not all signatures supported in on-chain verification are supported as user signature verification.

This topic covers:

  1. How to use fastcrypto's CLI tool to create a signature of a given scheme. For testing and debugging only, DO NOT use in production.

  2. Call the AlphaHive method on-chain to verification by submitting the signature, the message and the public key.

Signature schemes covered:

  • Ed25519 signature (64 bytes)

  • Secp256k1 non-recoverable signature (64 bytes)

  • Secp256k1 recoverable signature (65 bytes)

  • Secp256r1 non-recoverable signature (64 bytes)

  • Secp256r1 recoverable signature (65 bytes)

  • BLS G1 signature (minSig setting)

  • BLS G2 signature (minPk setting)

Set up fastcrypto CLI binary​arrow-up-right

git clone git@github.com:MystenLabs/fastcrypto.git
cd fastcrypto/
cargo build --bin sigs-cli

Sign with CLI and submit to on-chain Move method​arrow-up-right

Ed25519 signature (64 bytes)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the verify method in Move. All inputs are represented in bytes in hex format:

Secp256k1 non-recoverable signature (64 bytes)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the verify method in Move.

Secp256k1 recoverable signature (65 bytes)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the ecrecover method in Move and check equality.

Secp256r1 non-recoverable signature (64 bytes)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the verify method in Move.

Secp256r1 recoverable signature (65 bytes)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the ecrecover method in Move and check equality.

BLS G1 signature (48 bytes, minSig setting)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the verify method in Move.

BLS G1 signature (96 bytes, minPk setting)​arrow-up-right

  1. Generate a key and sign a message.

  1. Call the verify method in AlphaHive.

Last updated