Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"metadata": {
"description": "Zama skills for AI agents — the missing knowledge between models and production encrypted smart contracts.",
"version": "0.4.0"
"version": "0.4.1"
},
"plugins": [
{
"name": "zama-protocol",
"source": "./",
"description": "Three skills for building confidential dApps on Zama's FHEVM: zama-protocol (FHEVM model, packages, addresses), zama-solidity (encrypted Solidity, ACL, reveals, ERC-7984), and zama-typescript (@zama-fhe/sdk clients for React, viem, ethers and Node).",
"version": "0.4.0",
"version": "0.4.1",
"author": {
"name": "Zama Team",
"email": "plugins@zama.ai"
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"smart-contracts",
"confidential-computing"
],
"version": "0.4.0",
"version": "0.4.1",
"skills": "./skills/",
"interface": {
"displayName": "zama-protocol",
Expand Down
10 changes: 7 additions & 3 deletions .cursor/rules/zama-protocol-zama-solidity--code-map.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ _Reference for zama-solidity skill (zama-protocol plugin)_

## Deployed examples

Read verified source on Etherscan. The first two rows are fixed deployments that the registry does not track. Look up the others by name in the registry (**zama-protocol** → `references/addresses.md`). For a proxy, read its current implementation and linked libraries.
Links open Etherscan-verified source. For a proxy, open the implementation from the proxy's code tab: it can change on upgrade. Each row gives the contract's [registry](https://github.com/zama-ai/protocol-registry) key, and the registry decides which deployment is current (**zama-protocol** → `references/addresses.md`). The registry also lists further wrappers and batchers by type. AuctionToken and WalletFactory are fixed deployments that the registry does not track.

| Pattern | Contract | Start with |
|---------|----------|------------|
| ERC-7984 wrapper of an ERC-20 | [cUSDC](https://etherscan.io/address/0xe978F22157048E5DB8E5d07971376e86671672B2#code) (`CONFIDENTIAL_USDC`), proxy to `ConfidentialWrapper` | `wrap`, `unwrap` (marks the amount publicly decryptable), `finalizeUnwrap` (deletes the request, checks the proof, then pays). This is Zama's upgradeable variant with a blocklist; build new tokens on OpenZeppelin's `ERC7984ERC20Wrapper` |
| Finding a token's wrapper on-chain | [ConfidentialTokenWrappersRegistry](https://etherscan.io/address/0xeb5015fF021DB115aCe010f23F55C2591059bBA0#code) (`TOKEN_WRAPPER_REGISTRY`), proxy | `getConfidentialTokenAddress`, `isConfidentialTokenValid`: look wrappers up instead of hard-coding them |
| Batched deposits with an aggregate reveal | [Deposit](https://etherscan.io/address/0xA07c00A3b955B805B3Ea76b086f95a3e793715D5#code) and [redeem](https://etherscan.io/address/0x3a906d6509EB4171Ee9fC71D083fb1638BaF083D#code) batchers (`STEAKHOUSE_CONFIDENTIAL_PRIME_USDC_DEPOSIT_VAULT_BATCHER`, `STEAKHOUSE_CONFIDENTIAL_PRIME_USDC_REDEEM_VAULT_BATCHER`) | `VaultBatcherConfidential.join`, OpenZeppelin `BatcherConfidential`: `_join`, `dispatchBatchCallback`, `_claim`, `recover`, rounding, slippage. Small batches expose individual amounts. Each new batcher generation gets a new address; the registry key points to the current one |
| Swap with escrow and fees | [ConfidentialSwap](https://etherscan.io/address/0x8Fe22dC7e624c02b1805d41E09741490E1018C01#code) (`CONFIDENTIAL_SWAP`), proxy | `IntentLifecycleLib`, `EscrowLib`, `FeeLib.takeFee`: partitioned escrow, a fee computed with a shift, and why a shift of 64 needs its own case |
| Sealed bids paid in ERC-7984 | [AuctionToken](https://etherscan.io/address/0x04a5b8C32f9c38092B008A4939f1F91D550C4345#code) | `submitEncryptedBid`, `_computeBidAllocation`: payment checks on transferred amounts, division by a public denominator |
| Per-user wallets created as clones | [WalletFactory](https://etherscan.io/address/0xBf58EE954CaeeF84B44F30131421e606272E393F#code) | `WalletFactory`, `AuctionWallet.initialize`: partitioned custody, configuring FHE in a clone |
| Swap with escrow and fees | Registry entry `CONFIDENTIAL_SWAP` (Ethereum) | `IntentLifecycleLib`, `EscrowLib`, `FeeLib.takeFee`: partitioned escrow, a fee computed with a shift, and why a shift of 64 needs its own case |
| Batched deposits with an aggregate reveal | Registry entries of type `vault_batcher` (Ethereum) | `VaultBatcherConfidential`, OpenZeppelin `BatcherConfidential`: `_join`, `dispatchBatchCallback`, `_claim`, proof checks and rounding. Small batches expose individual amounts |

The swap and the auction grant decryption access to a compliance address. Those grants belong to those apps; do not copy them.

Verified source is not an audit. Read the callers and callees of any function you adapt, and check the installed API before reusing code.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,33 @@ All three install together. Their descriptions route protocol questions to `zama
/plugin install zama-protocol@zama-skills
```

Update later with `/plugin marketplace update zama-skills`.
To update, run from a terminal, then restart Claude Code:

```bash
claude plugin marketplace update zama-skills
claude plugin update zama-protocol@zama-skills
```

### Any AI agent (via `npx skills`)

```bash
npx skills add zama-ai/skills
npx skills add zama-ai/skills -g
```

Add `--list` to pick which skills to install: `npx skills add zama-ai/skills --list`.

Prefer a global install under `~/.agents` over per-project. Update later with `npx skills update`.
`-g` installs into `~/.agents/skills` and links the skills into each agent it detects. Omit it for a per-project install. `--list` shows the skills, and `--skill zama-solidity` installs one. Update later with `npx skills update -g`.

### Codex

```bash
codex plugin marketplace add zama-ai/skills
# then open /plugins in Codex and pick the Zama plugin
codex plugin add zama-protocol@zama-skills
```

Codex reads `.codex-plugin/plugin.json` and `.agents/plugins/marketplace.json` from the repo. Update later with `codex plugin marketplace upgrade zama-skills`.
You can also install it from `/plugins` inside Codex. To update, run `codex plugin marketplace upgrade zama-skills`, then `codex plugin add zama-protocol@zama-skills` again.

### Cursor

Cursor rules live under `.cursor/rules/`: one `.mdc` per skill plus one per reference (e.g. `zama-protocol-zama-solidity--erc7984.mdc`). Clone the repository once, then generate the rules into your project. Run the same commands to update:
Cursor rules live under `.cursor/rules/`: one `.mdc` per skill plus one per reference (e.g. `zama-protocol-zama-solidity--erc7984.mdc`). Clone the repository once, then generate the rules into your project with [uv](https://docs.astral.sh/uv/). To update, run the last two commands again:

```bash
git clone https://github.com/zama-ai/skills.git ~/src/zama-skills # first time only
Expand Down
10 changes: 7 additions & 3 deletions skills/zama-solidity/references/code-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@

## Deployed examples

Read verified source on Etherscan. The first two rows are fixed deployments that the registry does not track. Look up the others by name in the registry (**zama-protocol** → `references/addresses.md`). For a proxy, read its current implementation and linked libraries.
Links open Etherscan-verified source. For a proxy, open the implementation from the proxy's code tab: it can change on upgrade. Each row gives the contract's [registry](https://github.com/zama-ai/protocol-registry) key, and the registry decides which deployment is current (**zama-protocol** → `references/addresses.md`). The registry also lists further wrappers and batchers by type. AuctionToken and WalletFactory are fixed deployments that the registry does not track.

| Pattern | Contract | Start with |
|---------|----------|------------|
| ERC-7984 wrapper of an ERC-20 | [cUSDC](https://etherscan.io/address/0xe978F22157048E5DB8E5d07971376e86671672B2#code) (`CONFIDENTIAL_USDC`), proxy to `ConfidentialWrapper` | `wrap`, `unwrap` (marks the amount publicly decryptable), `finalizeUnwrap` (deletes the request, checks the proof, then pays). This is Zama's upgradeable variant with a blocklist; build new tokens on OpenZeppelin's `ERC7984ERC20Wrapper` |
| Finding a token's wrapper on-chain | [ConfidentialTokenWrappersRegistry](https://etherscan.io/address/0xeb5015fF021DB115aCe010f23F55C2591059bBA0#code) (`TOKEN_WRAPPER_REGISTRY`), proxy | `getConfidentialTokenAddress`, `isConfidentialTokenValid`: look wrappers up instead of hard-coding them |
| Batched deposits with an aggregate reveal | [Deposit](https://etherscan.io/address/0xA07c00A3b955B805B3Ea76b086f95a3e793715D5#code) and [redeem](https://etherscan.io/address/0x3a906d6509EB4171Ee9fC71D083fb1638BaF083D#code) batchers (`STEAKHOUSE_CONFIDENTIAL_PRIME_USDC_DEPOSIT_VAULT_BATCHER`, `STEAKHOUSE_CONFIDENTIAL_PRIME_USDC_REDEEM_VAULT_BATCHER`) | `VaultBatcherConfidential.join`, OpenZeppelin `BatcherConfidential`: `_join`, `dispatchBatchCallback`, `_claim`, `recover`, rounding, slippage. Small batches expose individual amounts. Each new batcher generation gets a new address; the registry key points to the current one |
| Swap with escrow and fees | [ConfidentialSwap](https://etherscan.io/address/0x8Fe22dC7e624c02b1805d41E09741490E1018C01#code) (`CONFIDENTIAL_SWAP`), proxy | `IntentLifecycleLib`, `EscrowLib`, `FeeLib.takeFee`: partitioned escrow, a fee computed with a shift, and why a shift of 64 needs its own case |
| Sealed bids paid in ERC-7984 | [AuctionToken](https://etherscan.io/address/0x04a5b8C32f9c38092B008A4939f1F91D550C4345#code) | `submitEncryptedBid`, `_computeBidAllocation`: payment checks on transferred amounts, division by a public denominator |
| Per-user wallets created as clones | [WalletFactory](https://etherscan.io/address/0xBf58EE954CaeeF84B44F30131421e606272E393F#code) | `WalletFactory`, `AuctionWallet.initialize`: partitioned custody, configuring FHE in a clone |
| Swap with escrow and fees | Registry entry `CONFIDENTIAL_SWAP` (Ethereum) | `IntentLifecycleLib`, `EscrowLib`, `FeeLib.takeFee`: partitioned escrow, a fee computed with a shift, and why a shift of 64 needs its own case |
| Batched deposits with an aggregate reveal | Registry entries of type `vault_batcher` (Ethereum) | `VaultBatcherConfidential`, OpenZeppelin `BatcherConfidential`: `_join`, `dispatchBatchCallback`, `_claim`, proof checks and rounding. Small batches expose individual amounts |

The swap and the auction grant decryption access to a compliance address. Those grants belong to those apps; do not copy them.

Verified source is not an audit. Read the callers and callees of any function you adapt, and check the installed API before reusing code.
Loading