Skip to content

Upgrade ark ecosystem dependencies to 0.5 (ark-ff, ark-ec, ark-serialize, etc.) #70

@himanshu-gq

Description

@himanshu-gq

Summary

The workspace currently pins ark-ff = "^0.4.1", ark-ec = "^0.4.1", ark-serialize = "^0.4.1", etc.
The ark ecosystem has shipped 0.5.0 (released Oct 2024), and downstream consumers using ark-ff 0.5
are forced to maintain byte-level serialization bridges between the two type systems to interoperate
with crates from this repository — in particular oblivious_transfer_protocols.

Motivation

We are integrating the oblivious_transfer_protocols crate (v0.12.0) into a system whose field layer
is built on ark-ff 0.5. Because ark-ff 0.4 and 0.5 are semver-incompatible, we currently need to:

  1. Carry dual ark-ff dependencies (ark-ff = "0.5" alongside ark-ff = "0.4" aliased as ark-ff-04)
  2. Serialize field elements to canonical bytes via ark-serialize 0.5, then deserialize via ark-serialize 0.4
    (and vice versa) at every crossing point
  3. Maintain property-based tests to verify arithmetic preservation across the bridge

This works, but it adds unnecessary indirection, a non-trivial test surface, and prevents type-level
compatibility between our field types and the ones used internally by oblivious_transfer_protocols
(e.g., in the DKLS18/DKLS19 multiplication interfaces).

Scope

Based on the workspace Cargo.toml, the upgrade would touch these workspace dependencies:

Dependency Current Target
ark-ff ^0.4.1 ^0.5.0
ark-ec ^0.4.1 ^0.5.0
ark-std ^0.4.0 ^0.5.0
ark-serialize ^0.4.1 ^0.5.0
ark-poly ^0.4.1 ^0.5.0
ark-relations ^0.4.0 ^0.5.0
ark-r1cs-std ^0.4.0 ^0.5.0
ark-groth16 ^0.4.0 ^0.5.0
ark-bls12-381 ^0.4.0 ^0.5.0
ark-secp256r1 ^0.4.0 ^0.5.0

This is a workspace-wide change since the versions are defined in [workspace.dependencies].

Breaking changes in ark 0.5

The ark 0.4 → 0.5 migration is not trivial but well-documented. Key changes include:

  • Field trait method signature changes
  • Serialization format changes (canonical encoding remains little-endian but some wrapper types differ)
  • CanonicalSerialize / CanonicalDeserialize API changes
  • Some re-exports moved between crates

The arkworks team maintains a migration guide.

Proposal

Would you be open to a PR upgrading the ark ecosystem dependencies to 0.5? Happy to contribute
if the maintainers are aligned on the direction. If there are specific concerns or blockers for
the upgrade, it would be helpful to understand them so we can plan accordingly (our fallback is to
maintain a fork with the upgrade applied).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions