Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Designing public vs. private state: what goes where and why

DEV Community·Tosin Akinbowa·24 days ago
#sozwF69v
Reading 0:00
15s threshold

One of the most common sources of confusion when building on Midnight is the question of privacy. Developers expect that marking something as "not exported" or keeping it off the main interface will make it private. It does not. On Midnight, privacy is a deliberate design decision that requires using the right tools at the right layer. This tutorial gives you a clear framework for making that decision. By the end, you will understand the three layers of data in a Midnight smart contract, when to use disclose() , the difference between shielded and unshielded tokens, and the common mistakes that accidentally leak private information. Prerequisites Midnight toolchain installed ( installation guide ) Basic familiarity with Compact. If you have not worked through the hello world tutorial, start there Node.js installed for running tests The three layers of data Every Midnight smart contract works with data at three distinct layers. Getting clarity on these layers is the foundation of good privacy design.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More