-
Notifications
You must be signed in to change notification settings - Fork 38
Upgrade ark ecosystem dependencies to 0.5 (ark-ff, ark-ec, ark-serialize, etc.) #70
Description
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:
- Carry dual ark-ff dependencies (
ark-ff = "0.5"alongsideark-ff = "0.4"aliased asark-ff-04) - 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 - 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:
Fieldtrait method signature changes- Serialization format changes (canonical encoding remains little-endian but some wrapper types differ)
CanonicalSerialize/CanonicalDeserializeAPI 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).