# What is the behavior of the disclose() function in Compact?

**URL:** <https://forum.midnight.network/t/what-is-the-behavior-of-the-disclose-function-in-compact/24>\
**Category:** Technical Questions\
**Tags:** previously-asked, compact, learning\
**Created:** [May 12, 2025, 7:16pm UTC](https://forum.midnight.network/t/what-is-the-behavior-of-the-disclose-function-in-compact/24 "2025-05-12T19:16:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamanthaHolstine](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/samanthaholstine/32/14_2.png) [@SamanthaHolstine](https://forum.midnight.network/u/SamanthaHolstine)\
**Post date:** [May 12, 2025, 7:16pm UTC](https://forum.midnight.network/t/what-is-the-behavior-of-the-disclose-function-in-compact/24/1 "2025-05-12T19:16:34Z")

</div>

I’m trying to understand the disclose() function and it’s impact on and privacy selective disclosure in a permissioned DApp context.

I’m looking at Midnight’s [documentation](https://docs.midnight.network/develop/reference/compact/explicit_disclosure) and looking at this example:

```auto
import CompactStandardLibrary;
witness get_balance(): Bytes<32>;
export ledger balance: Bytes<32>;

export circuit record_balance(): [] {
    balance = disclose(get_balance());
}

```

When disclose(get\_balance()) is used to assign a value to the public ledger variable balance, does this mean the private witness data (get\_balance()) becomes permanently readable by all users on the public ledger, or is the disclosed data only accessible to specific parties (e.g., the caller or permissioned users)? If it’s fully public, how does this align with the concept of selective disclosure?

---

<div class="post-metadata">

**Author:** ![SamanthaHolstine](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.midnight.network/samanthaholstine/32/14_2.png) [@SamanthaHolstine](https://forum.midnight.network/u/SamanthaHolstine)\
**Post date:** [May 12, 2025, 7:16pm UTC](https://forum.midnight.network/t/what-is-the-behavior-of-the-disclose-function-in-compact/24/2 "2025-05-12T19:16:44Z")

</div>

`disclose(get_balance())` doesn’t make the value of `get_balance` readable. It just makes it okay to write it to the public ledger. Writing it to the public ledger would then make that value visible, and we want the programmer to have to explicitly write some code to acknowledge that is what they intended.
