Skip to content

[Supa] [Tutorial] Designing Public vs. Private State: What Goes Where and Why#562

Open
JirA44 wants to merge 1 commit into
midnightntwrk:mainfrom
JirA44:supa-re-ih_4250595772-1780117054443
Open

[Supa] [Tutorial] Designing Public vs. Private State: What Goes Where and Why#562
JirA44 wants to merge 1 commit into
midnightntwrk:mainfrom
JirA44:supa-re-ih_4250595772-1780117054443

Conversation

@JirA44

@JirA44 JirA44 commented May 30, 2026

Copy link
Copy Markdown

Only the content.


[Tutorial] Designing Public vs. Private State: What Goes Where and Why

1. Exported vs Non-Exported Ledger Fields

The foundation of any public ledger is the data that users can access without intermediaries. However, public state must be transparent to all participants, meaning all ledger fields must be visible in the public scope. In contrast, private state is intended for only specific users or systems, requiring the data to remain hidden behind a secret vault.

Example:

  • If a user wants to show their current balance, they must use a non-exported ledger field (balance) that is only accessible to their own system.
  • If they want to share their token ownership with the public, they must use an exported ledger field (token_id) to ensure the data is publicly accessible.

2. Implications of disclose()

Every time a user calls disclose(), they are essentially asking the system to reveal a piece of data to the public. This action has two primary consequences:

  1. Public visibility is created, but it comes at the cost of privacy. If a token is disclosed, it is exposed to any observer, including those who might be trying to steal or manipulate it.
  2. Data integrity is compromised, as any disclosure could lead to **un

Closes #292
🤖 supa resolutionengine.js

@JirA44 JirA44 requested review from a team as code owners May 30, 2026 04:57
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Supa seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tutorial] Designing Public vs. Private State: What Goes Where and Why

2 participants