Skip to content

Releases: zama-ai/relayer-sdk

v0.5.0-rc.1

16 Jun 18:20
d06f1e5

Choose a tag to compare

v0.5.0-rc.1 Pre-release
Pre-release

First release candidate for 0.5.0.

Includes: surface relayer/edge (Cloudflare/Kong) error messages on 401/403 instead of generic or assumed messages (#451).

Published to npm under the prerelease tag.

v0.4.4

16 Jun 18:19
8738944

Choose a tag to compare

Surface relayer/edge (Cloudflare/Kong) error messages on 401/403 instead of generic or assumed messages (#452).

v0.4.3

06 May 09:54
f5365ff

Choose a tag to compare

What's Changed

Full Changelog: v0.4.2...v0.4.3

v0.5.0-alpha.3

10 Apr 13:31
2cb48f6

Choose a tag to compare

v0.5.0-alpha.3 Pre-release
Pre-release

What's Changed

  • fix: remove v1 route and update tests for devnet v0.12 by @geoxel in #439
  • Deprecated FhevmInstanceConfig.relayerRouteVersion

New Contributors

Full Changelog: v0.5.0-alpha.2...v0.5.0-alpha.3

v0.5.0-alpha.2

30 Mar 11:04
e833b38

Choose a tag to compare

v0.5.0-alpha.2 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.4.2...v0.5.0-alpha.2

v0.5.0-alpha.1

20 Mar 10:14
7dd9c27

Choose a tag to compare

v0.5.0-alpha.1 Pre-release
Pre-release

Breaking Change: Context-Aware extraData for User Decryption (v0.5.0-alpha.1)

Starting with v0.5.0-alpha.1, the relayer SDK introduces KMS context-aware decryption. The extraData field — previously managed internally by the SDK — now carries a versioned context identifier that ties each decryption request to a specific KMS signer set. This enables the KMS to rotate its signer configuration (context switches) without breaking in-flight requests: each request and its verification are bound to the exact signer set that was active when the request was built.

What you need to change for user decrypt and delegated user decrypt flows:

The new fhevmInstance.getExtraData() method fetches the current KMS context and returns the properly formatted extraData value. You must pass the same extraData to both the EIP-712 builder and the decrypt call so that the signature and the request reference the same context.

// 1. Fetch extraData and build the EIP-712 message
const extraData = await fhevmInstance.getExtraData();

const eip712 = fhevmInstance.createEIP712(
  publicKey, contractAddresses, startTimestamp, durationDays,
  extraData,  // ← new required parameter
);

// 2. Have the user sign the EIP-712 message
const signature = await wallet.signTypedData(/* ... */);

// 3. Cache the signature + extraData pair for later use

Handling context rotation:

The KMS context rotates approximately every two weeks. You can cache the signature, but before submitting the decrypt request you should check whether the context has changed:

// 4. When ready to decrypt, fetch extraData again
const currentExtraData = await fhevmInstance.getExtraData();

// 5. If the context changed, the cached signature is invalid — re-sign
if (currentExtraData !== extraData) {
  // Context has rotated — rebuild EIP-712 with new extraData and re-sign
  const newEip712 = fhevmInstance.createEIP712(
    publicKey, contractAddresses, startTimestamp, durationDays,
    currentExtraData,
  );
  signature = await wallet.signTypedData(/* ... with newEip712 ... */);
  extraData = currentExtraData;
}

// 6. Submit the decrypt request with matching extraData + signature
const results = await fhevmInstance.userDecrypt(
  handleContractPairs, publicKey, privateKey, signature,
  userAddress, startTimestamp, durationDays,
  extraData,  // ← must match what was signed
);

The same pattern applies to the delegated user decrypt flow — call getExtraData(), pass it to createDelegatedUserDecryptEIP712(), and then to delegatedUserDecrypt().

Public decryptions are not affected. Since publicDecrypt does not involve a user signature, the SDK resolves the context internally — no code changes needed on your side.

Migration summary:

Method Change
getExtraData() New — call before building EIP-712 and again before decrypting
createEIP712() New extraData parameter (6th argument)
createDelegatedUserDecryptEIP712() New extraData parameter (7th argument)
userDecrypt() New extraData parameter (8th argument, before options)
delegatedUserDecrypt() New extraData parameter (9th argument, before options)
publicDecrypt() No change — handled internally

The key rule: the extraData used in the EIP-712 signature must match the extraData passed to the decrypt call. Cache the signature freely, but re-check getExtraData() before submitting — if the context rotated, re-sign.

What's Changed

Full Changelog: v0.4.2...v0.5.0-alpha.1

v0.4.2

06 Mar 15:53
f5f4b23

Choose a tag to compare

What's Changed

Full Changelog: v0.4.1...v0.4.2

v0.4.1

14 Feb 14:22
2988f6a

Choose a tag to compare

What's Changed

  • fix CLI issues
  • fix relayer v2 route 503 error labels: xxx_timed_out
  • add new relayer v2 route 503 error labels: insufficient_xxx

Full Changelog: v0.4.0...v0.4.1

v0.4.0

31 Jan 11:09
268c3e4

Choose a tag to compare

  • v0.4.0 release
  • add x-api-key to request headers for GET endpoints
  • remove default public RPC urls
  • add doc
  • fix fetch bytes

v0.4.0-5

29 Jan 08:31
15ef35d

Choose a tag to compare

v0.4.0-5 Pre-release
Pre-release

What's Changed

  • feat: implement delegated user decryption for v2 endpoints

Full Changelog: v0.4.0-4...0.4.0-5