Back to Fhevm

Compatibility

sdk/js-sdk/docs/compatibility.md

0.14.0-09.1 KB
Original Source

Github

kms: https://github.com/zama-ai/kms tfhe-rs: https://github.com/zama-ai/tfhe-rs

Limitations

There is no on-chain or relayer-side signal that tells the SDK the minimum tfhe.wasm version required to deserialize a given PubKey/CRS pair, and the format is not forward-compatible across minor versions:

Heuristic

Lacking a direct signal, the SDK derives the right tfhe.wasm version from a protocol context:

  1. Read ACL.version on the host chain and map it to a protocol version.
  2. Resolve the PubKey/CRS version from what this SDK knows at the time it is written:
    • for known public relayers, use the PubKey/CRS version they are known to serve at SDK release time;
    • otherwise, use the PubKey/CRS version expected when fresh key material is generated for that protocol line.
  3. Map (protocol version, PubKey/CRS version) to a wasm version:
    • Protocol < v0.13.0 with PubKey/CRS < v1.6.0[email protected]
    • Protocol ≥ v0.13.0 with PubKey/CRS < v1.6.0[email protected] by default, while v1.5.3 remains compatible for the current legacy public PubKey/CRS.
    • Protocol ≥ v0.13.0 with PubKey/CRS ≥ v1.6.0[email protected]

The PubKey/CRS part is a release-time snapshot, not a future-proof signal. After the SDK is published, key rotation or CRS removal can change the material served by a relayer. The SDK cannot guess those future changes without a direct on-chain or relayer-side version signal.

The protocol-version part works as long as every protocol release bumps at least one host-contract version. See the open question on this assumption below if it ever breaks.

In the future: add view functions in InputVerifier.sol and KMSVerifier.sol or ProtocolConfig.sol

KMS

KMS releases pin an exact tfhe-rs crate version via tfhe = "=X.Y.Z" in the workspace Cargo.toml.

KMS versiontfhe-rs crateNotes
0.12.40.12.71.4.0-alpha.3initial line, prerelease alpha
0.13.00.13.31.5.1tfhe minor bump (1.41.5)
0.13.101.5.4tfhe patch bump within 1.5.x
0.13.20-01.6.1tfhe minor bump (1.51.6)

Chains

KMS 0.12.7 generated the PubKey/CRS in December 2025

ChainProtocolPubKey/CRS
Mainnet0.11.01.4.0-alpha.3
Testnet0.13.01.4.0-alpha.3
Devnet0.13.01.4.0-alpha.3
Polygon-Amoy (Devnet)0.13.01.4.0-alpha.3

Contract and components versions

On-chain contracts

ProtocolACLFHEVMExecutorKMSVerifierInputVerifierHCULimitProtocolConfigPauserSet
0.10.00.2.00.1.00.1.00.2.00.1.0-0.1.0
0.11.00.2.00.2.00.1.00.2.00.1.0-0.1.0
0.12.00.3.00.3.00.2.00.2.00.2.0-0.1.0
0.13.00.4.00.4.00.3.00.2.00.3.00.1.00.1.0
0.14.00.5.0?0.4.0??0.2.0?

Off-chain components

ProtocolTFHEKMSExtra data
0.10.01.4.0-alpha.30.12.4v0
0.11.01.5.10.13.3v0
0.12.01.5.40.13.10v1
0.13.01.6.10.13.20-0v1
0.14.0??v2

PubKey/Crs versions on existing chains and compatibility with other TFHE versions

ChainProtocolPubKey/CRS (TFHE)TFHE 1.5.3TFHE 1.6.1
Mainnet0.11.01.4.0-alpha.3
Testnet0.13.01.4.0-alpha.3
Devnet0.13.01.4.0-alpha.3

Localstack

ProtocolPubKey/CRS (TFHE)Readable by TFHE 1.5.3Readable by TFHE 1.6.1
0.11.01.5.1
0.12.01.5.4
0.13.01.6.1
0.14.0??

TFHE API

ProtocolTFHETypesFunctions
v0.11.0
v0.12.0
v0.13.0
v0.14.0
v1.5.3
v1.6.1CompactCiphertextList.builder
CompactCiphertextListBuilder.push_boolean
CompactCiphertextListBuilder.push_u8
CompactCiphertextListBuilder.push_u16
CompactCiphertextListBuilder.push_u32
CompactCiphertextListBuilder.push_u64
CompactCiphertextListBuilder.push_u128
CompactCiphertextListBuilder.push_u160
CompactCiphertextListBuilder.push_u256
CompactCiphertextListBuilder.build_with_proof_packed
CompactCiphertextListBuilder.free
CompactPkeCrs.safe_serialize
CompactPkeCrs.safe_deserialize
ProvenCompactCiphertextList.safe_serialize
ProvenCompactCiphertextList.safe_deserialize
ProvenCompactCiphertextList.free
ProvenCompactCiphertextList.len
ProvenCompactCiphertextList.get_kind_of
TfheCompactPublicKey.safe_serialize
TfheCompactPublicKey.safe_deserialize
ZkComputeLoadinit_panic_hook
initThreadPool
setWorkerUrlConfig
getWasmInfo

KMS API

ProtocolKMSTypesFunctions
v0.11.0
v0.12.0
v0.13.0
v0.14.0
v0.13.x
v0.14.0Client
PrivateEncKeyMlKem512
PublicEncKeyMlKem512
ServerIdAddr
TypedPlaintextnew_client
new_server_id_addr
ml_kem_pke_keygen
ml_kem_pke_get_pk
ml_kem_pke_pk_to_u8vec
ml_kem_pke_sk_to_u8vec
u8vec_to_ml_kem_pke_sk
process_user_decryption_resp_from_js