Skip to content

vixuslabs/signature_poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Mina Digital Signature Issue Reproduction

Overview

This repository is dedicated to reproducing an issue we have encountered related to digital signatures using the Mina protocol. The core of the issue lies in the verification process of a digital signature generated in Rust and then verified in TypeScript using o1js.

The Rust script uses the mina-signer crate to generate a digital signature for an array of u8 numbers, then saves this data along with the associated public key and the base58 encoded signature into a JSON file. The TypeScript script (using the Signature class from o1js) attempts to verify this signature but fails despite using identical data and public key parameters.

The primary goal here is to reach out to the Mina community for insights or solutions and document any progress or findings related to this issue.

Repository Structure

  • rust/: Contains the Rust script for generating the digital signature and exporting the necessary data.
  • o1js/: Contains the TypeScript script intended to verify the signature generated by the Rust script.

Issue Description

When attempting to verify a digital signature (using o1js) that was generated in Rust (using mina-signer), the verification fails. This is puzzling as the data, public key, and signature remain consistent across both implementations.

Prerequisites

  • Rust installation for running Rust scripts.
  • Node.js and pnpm for handling JavaScript dependencies and running the TypeScript script.

Running the Code

Rust

To generate the digital signature and associated data:

  1. Navigate to the signature_poc/rust directory.
  2. Execute the command:
    cargo run

This will generate a JSON file containing the signed data, the digital signature, and the public key, and will save it to the o1js/web directory.

o1js

To verify the signature:

  1. Ensure you have pnpm installed. If not, you can install it using npm install -g pnpm.

  2. Navigate to the signature_poc/o1js directory.

  3. Install the necessary dependencies:

    pnpm install
  4. Run the local development server:

    pnpm vite
  5. Open a browser and navigate to localhost:5173 to execute the TypeScript script.

  6. Open the browser's console and check the logs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published