Skip to main content

ACE Python SDK

Python SDK for ACE (Aptos Confidential Extension). This package mirrors the core crypto and wire-format surface of @aptos-labs/ace-sdk for Python callers.

The SDK currently includes:

  • BCS helpers for the wire formats ACE uses.
  • Scheme-tagged BLS12-381 G1/G2 group wrappers.
  • Feldman/Shamir VSS helpers.
  • Pedersen polynomial commitments, DKG and DKR state decoders.
  • Public-key encryption schemes used by ACE.
  • Scheme-tagged Ed25519 signing helpers for reconstructor/admin flows.
  • Threshold IBE primitives.
  • Known deployment metadata and network state view decoders.
  • Discovery snapshot decoding for the keyless discovery service.
  • Aptos IBE encryption helpers.
  • Worker decryption request helpers for basic and custom flows.
  • Disaster-recovery master-secret reconstruction helpers.
  • Aptos threshold-VRF request, share verification, and output reconstruction helpers.

Install for local development

python -m venv .venv
.venv/bin/python -m pip install -e '.[dev]'

Quick check

from ace_sdk import pke

encryption_key, decryption_key = pke.keygen()
ciphertext = pke.encrypt(encryption_key, b"hello ace")
plaintext = pke.decrypt(decryption_key, ciphertext).unwrap_or_throw("decrypt failed")
assert plaintext == b"hello ace"

The API follows Python naming conventions (from_bytes, to_hex, derive_encryption_key) while preserving ACE's byte-level compatibility with the TypeScript SDK.

The default PKE scheme is HPKE and does not require native system libraries. The legacy ElGamalOtpRistretto255 scheme requires libsodium >= 1.0.18 with the crypto_core_ristretto255_* APIs. Install it with your system package manager, or set ACE_SDK_LIBSODIUM_PATH to the library path.

Admin IBE validation

The reconstructed master secret printed by the ACE disaster-recovery flow is a 32-byte little-endian Fr scalar. Use it to extract a full identity decryption key and validate a ciphertext:

from ace_sdk import t_ibe

idk = t_ibe.extract(msk_scalar=msk_scalar, identity=label).unwrap_or_throw("extract")
plaintext = t_ibe.decrypt([idk], ciphertext).unwrap_or_throw("decrypt")

For Aptos app encryption, ibe_aptos.encrypt builds the same full decryption domain as the TypeScript SDK before t-IBE encryption.

Benchmarks

The BLS12-381 pairing implementation is pure Python and intentionally kept out of the default test suite. Run its opt-in benchmark with:

python benchmarks/bench_pairing.py --iterations 5

Aptos custom flow

For custom access-control flows, callers provide the application proof payload and the PKE keypair that workers should use to encrypt returned IDK shares:

from ace_sdk import ibe_aptos, pke

enc_pk, enc_sk = pke.keygen()
plaintext = ibe_aptos.decrypt_custom_flow(
    ace_deployment=deployment,
    keypair_id=keypair_id,
    chain_id=chain_id,
    module_addr=module_addr,
    module_name="example",
    label=b"object-id",
    enc_pk=enc_pk,
    enc_sk=enc_sk,
    payload=custom_proof_payload,
    ciphertext=ciphertext_bytes,
).unwrap_or_throw("custom decrypt")

Release files for aptos-ace-sdk 3.12.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aptos-ace-sdk 3.12.3
File Size Uploaded
aptos_ace_sdk-3.12.3.tar.gz 59.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aptos-ace-sdk 3.12.3
File Interpreter ABI Platform
aptos_ace_sdk-3.12.3-py3-none-any.whl Python 3 none any Details

Total release size: 137.5 kB

Release files / aptos_ace_sdk-3.12.3.tar.gz

Download URL aptos_ace_sdk-3.12.3.tar.gz
Size 59.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e2bdd5365b0d2163f84c4c621d26f43ee050dab9252b21cd57f33baeb6576443
BLAKE2b-256 checksum
How to use checksums
bea7254af33e4386d9fd61b9c237213f7201f615f43b1bf317c1f7208788d424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / aptos_ace_sdk-3.12.3-py3-none-any.whl

Download URL aptos_ace_sdk-3.12.3-py3-none-any.whl
Size 78.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21d0e239e6317ef7bc23efd5c74cdb98f9bc12d074edd4cbd9445b0b3a22b4f6
BLAKE2b-256 checksum
How to use checksums
cb2d8f2005c4307ee6d1b4bc8f8c6a142ac9de72b9391d4020ff2e78c6c78c27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

5.0.7

2 release files

5.0.6

2 release files

5.0.5

2 release files

5.0.4

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

3.12.4

2 release files

This release

3.12.3 This release

2 release files

3.12.2

2 release files

3.12.1

2 release files

3.11.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page