S&P Global Enters Agreement to Acquire OpenZeppelinRead the announcement
Midnight logoOpen Zeppelin Z

Build Securely on Midnight with OpenZeppelin

OpenZeppelin brings its trusted libraries to Compact, Midnight’s TypeScript-inspired smart contract language. Built for privacy and compliance, these standards enable developers to create applications that safeguard data across DeFi, NFTs, identity, and Real-World Assets.

pragma language_version >= 0.14;

import CompactStandardLibrary;
import "openzeppelin-compact/token/FungibleToken" prefix FungibleToken_;

export ledger owner: Bytes<32>;

constructor(initialOwner: Bytes<32>) {
  owner = initialOwner;
  FungibleToken_initialize("MyToken", "MTK", 18);
}

export circuit mint(to: Either<ZswapCoinPublicKey, ContractAddress>, amount: Uint<128>): [] {
  FungibleToken__mint(to, amount);
}

OpenZeppelin Compact Contracts

Build DeFi, identity, and tokenization applications on Midnight with battle-tested contract libraries for Compact, leveraging selective disclosure and privacy-preserving features.

Open Source Tools

Relayer (Coming soon)

Broadcast Compact contract transactions securely while preserving data confidentiality, ensuring private interactions reach the Midnight network seamlessly.

Code snippet showing JavaScript async/await syntax for sending a blockchain transaction with address, value, data, and isPrivate parameters.

Monitor (Coming soon)

Track Compact contracts behavior to detect anomalies, monitor execution patterns, and trigger alerts without compromising sensitive data or user privacy.

Security alert notification showing high severity suspicious swap detected with incident details and response status.

UI Builder

Generate working interfaces for Compact contracts in seconds to test privacy-enabled functions without building custom front-ends.

Try UI Builder
Ui builder dark pop

Compact Security Detectors SDK

Identify vulnerabilities in Compact contracts before deployment with integrated security analysis to ship secure code across DeFi, identity, and tokenization applications on Midnight.

Github
Midnight asset compact

Starter Apps

LunarSwap

Explore privacy-enabled DeFi on Midnight with LunarSwap, a decentralized exchange reference implementation built with Compact Contracts. Featuring concentrated liquidity mechanics and shielded swap capabilities, it demonstrates how modern AMM design integrates seamlessly with Midnight's privacy-first architecture.

Use LunarSwap as your blueprint for building privacy-ready DeFi applications. Review Compact contract patterns, examine offchain component integration, and understand how to implement liquidity provisioning with selective disclosure. Built with Next.js and robust Compact math modules for production-grade privacy applications.

Enterprise-grade compliance and certifications

  • CCPA Compliant
  • SOC2 Certified
  • GDPR Compliant

Security Services

Smart Contract Security Audit

Secure your Midnight applications with comprehensive smart contract audits covering DeFi, identity, and tokenization protocols with privacy-preserving features.

audits

Blockchain Infrastructure Audit

Strengthen your offchain infrastructure through specialized audits of rollup components, sequencers, bridges, and privacy-preserving systems of your Midnight apps.

blockchain infra

The security standard for onchain finance

Talk to an Expert