# Compact Under the Hood: How Midnight’s Smart Contract Language Encodes Privacy by Default

**URL:** <https://forum.midnight.network/t/compact-under-the-hood-how-midnight-s-smart-contract-language-encodes-privacy-by-default/1092>\
**Category:** Technical Questions\
**Created:** [March 20, 2026, 8:56am UTC](https://forum.midnight.network/t/compact-under-the-hood-how-midnight-s-smart-contract-language-encodes-privacy-by-default/1092 "2026-03-20T08:56:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![8pro](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/8pro/32/446_2.png) [@8pro](https://forum.midnight.network/u/8pro)\
**Post date:** [March 20, 2026, 8:56am UTC](https://forum.midnight.network/t/compact-under-the-hood-how-midnight-s-smart-contract-language-encodes-privacy-by-default/1092/1 "2026-03-20T08:56:20Z")

</div>

Hey everyone 👋

I just published a deep dive on Compact, Midnight’s smart contract language, focusing on how it enforces **privacy by default** at the language level.

The article explores a key shift in how we think about smart contracts:

Instead of executing code on-chain, Compact defines logic that is **proven using zero-knowledge systems** , meaning data can remain private while still being verifiable.

Some highlights:  
• Why Compact is not a general-purpose language  
• How circuits replace traditional functions  
• The role of witnesses and private inputs  
• Why `disclose` is mandatory for transparency  
• The shift from execution → verification

This is especially useful if you’re trying to understand how Midnight differs from traditional chains like Ethereum.

📖 Read here:  
[https://eightblock.dev/articles/compact-under-the-hood-how-midnight-s-smart-contract-language-encodes-privacy-by-default](https://eightblock.dev/articles/compact-under-the-hood-how-midnight-s-smart-contract-language-encodes-privacy-by-default)

Would love to hear your thoughts, especially from builders already experimenting with Compact.

 ![main image](https://canada1.discourse-cdn.com/flex010/uploads/midnightnetwork/original/1X/2230d56afc33fdd6ffacdb3db5ccfc5a18b51db8.jpeg)
