---
# System prepended metadata

title: Mina AES Grant Proposal

---

anment.

## Proposal Overview
- **Problem:** AES, as a cryptographic primitive, has not been implemented in a provable format and cannot be verified by the Mina blockchain.
- **Solution:** Implement an AES Zero-Knowledge Program for on-chain verification.
- **Impact:** An AES cryptographic primitive will be an essential contribution to zkTLS, enabling developers to build more advanced cryptographic use cases easily.
- **Audience:** Mina developers, Mina Protocol.

## Architecture & Design
- **Detailed Design/Architecture:** The proposers currently have a proof-of-concept AES codebase capable of verifying 128-bit ciphertext messages. However, this codebase is a prototype and requires significant modifications, including implementing the [S-Box](https://en.wikipedia.org/wiki/Rijndael_S-box), various block mode of operations (e.g., [CTR](https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation)), and key expansion to support different key sizes. Additionally, a comprehensive test suite is crucial to ensure correctness during development.
- **Vision:** Provide a well-documented, robust library for the AES scheme, which can be easily utilized for future development.
- **Existing Work:** See the current proof-of-concept [here](https://github.com/scaraven/eth-oxford).
- **Production Timeline:** One calendar month after proposal approval.

## Budget & Milestones

- **Deliverables:** A verifiable, well-documented AES scheme implemented in o1js.
- **Mid-Point Milestone:** A verifiably correct and tested AES implementation without AES mode support.
- **Project Timeline:** 1 month.
- **Budget Requested:** 15,000 MINA.
- **Budget Breakdown:** N/A.
- **Wallet Address:** B62qqFn6NzvMpUtx8eT1Bh7ohgVSjUjxTE6G94PivrHGgaLtq3HBz2w.

## Detailed Breakdown

### Core:
- Integrating previously completed **ShiftRows** and **MixColumns** stages into the new codebase. 
- Implementing an algorithmic (rather than memory-heavy) **S-Box** or with a provable **Merkle Map**.
- Key expansion.
- Padding message text using **PKCS7** (off-circuit).
- Implementing block mode: **Counter Mode (CTR)**.
- Testing: Since AES is a security primitive, we propose testing with millions of randomly generated inputs and comparing results against an industrial implementation (**Differential Testing**).
- Creating documentation with libraries such as [documentation.js](https://documentation.js.org/).

### Optional:
- User authentication block mode: **Galois Counter Mode (GCM)**.
- Additional testing: Deploying on a testnet and running integration tests.
- Addressing trade-offs between recursion and off-chain computation for an optimized design.
- Benchmarking: Exploring optimizations to minimize circuit size.

## Team Info

This section provides details about the team.

- **Team Members:**
  - Nicolas Schleicher: [scaraven](https://github.com/scaraven).
  - Jakub Cabala: [jCabala](https://github.com/jCabala).
  - Edwin Fernando: [edwin](https://github.com/edwin1729).

## Risks & Mitigations

- If implemented incorrectly, AES can introduce security vulnerabilities, including but not limited to allowing attackers to forge valid proofs for fake ciphertexts.
- **Mitigations:** Robust testing including integration and unit tests. Additionally, a security audit by experienced third party specialists is vital to ensure that no vulnerabilities exist within the implementation.
