Witnesses Explained: How Midnight Uses Private Data Without Exposing It

Hey everyone :waving_hand:

I just published a deep dive into one of the most important concepts in Midnight: witnesses.

If you’ve gone through the early lessons, you’ve probably noticed something:

Everything works… but everything is public.

Witnesses are what change that.

They allow your contracts to:

  • Access private data

  • Use it inside circuits

  • Prove correctness

  • Without ever putting that data on-chain

The article covers:
• What a witness actually is
• How it connects Compact → TypeScript
• Why witness data is treated as untrusted input
• How disclose() controls what becomes public
• How everything fits into the transaction lifecycle

If you’re planning to build anything serious on Midnight, this is a concept you need to fully understand.

Would love your thoughts or questions :raising_hands:

https://eightblock.dev/articles/witnesses-on-midnight-how-private-data-enters-a-public-ledger-without-being-seen

3 Likes