Abric-language-kotlin ^new^ -
The library typically consists of several layers:
Then write your first protocol:
Write protocols like this:
val proactiveRefresh = protocol val parties = listOf(p1, p2, p3) val oldShares = inputShares(parties) // Each party generates a random blinding share val randoms = parties.map randomShare()
For researchers and advanced practitioners in MPC and ZK, Abricot offers a clean, expressive syntax to prototype and analyze protocols before committing to low-level implementations. As the field of secure computation matures, tools like Abricot may become essential for building the next generation of privacy-preserving applications. Note: Because abricot-language-kotlin may be an internal or less-documented project, always refer to its official repository for the most accurate and up-to-date syntax and features. This article is based on common patterns in cryptographic DSLs and the described architecture of similar systems. abric-language-kotlin
Abricot introduces Secret<T> as a type that cannot be observed by the runtime unless explicitly declassified or reconstructed via MPC. This enables automatic tracking of information flow.
┌─────────────────────────────────────────────┐ │ High-level DSL (Kotlin) │ │ protocol input(...) output(...) ... │ └─────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────┐ │ Intermediate Representation │ │ (IR) – Linearized sequence of gates │ └─────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────┐ │ Analysis Modules │ │ - Information flow │ │ - Leakage detection │ │ - Complexity estimation │ └─────────────────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────┐ │ Code Generation Backends │ │ - MP-SPDZ │ │ - SCALE-MAMBA (for ZK) │ │ - Custom networking stubs (Kotlin/Netty) │ └─────────────────────────────────────────────┘ | Feature | Abricot (Kotlin) | Circom (ZK-SNARKs) | MP-SPDZ high-level | |------------------------|------------------|--------------------|--------------------| | Host language | Kotlin (JVM) | Custom language | Python-like script | | Type system | Full Kotlin types + Secret | Static, signal-based | Dynamic | | Reusable sub-protocols | Yes (functions) | Yes (templates) | Yes (functions) | | Automatic malicious security | Partially via ZK insertion | No (must specify constraints) | Via compiler flags | | IDE support | Full (IntelliJ) | Limited | Limited | | Compilation target | MPC, ZK, simulation | R1CS + witness | Various MPC engines | 5. Example: Proactive Secret Sharing in Abricot One of the classic use cases for Abricot is proactive secret sharing — where shares are refreshed periodically to maintain security against mobile adversaries. The library typically consists of several layers: Then
import fr.ens.abricot.* fun main() val protocol = protocol val a = secretInput(party("Alice"), 42) val b = secretInput(party("Bob"), 117) val c = add(a, b) val result = reveal(c) output(result, party("Charlie"))