re-write docs for confidential_asset v1.1#389
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Rewrites the Confidential Asset v1.1 documentation to reflect updated on-chain concepts (store/balance types, _raw entry functions, auditors) and to reposition the TypeScript SDK as the primary integration path.
Changes:
- Updated the smart-contract documentation to the new “ConfidentialStore” / pending+available balance model, with revised entry/view function references.
- Simplified and modernized the TypeScript SDK guide around
@aptos-labs/confidential-assetsand a unified WASM initialization flow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/content/docs/build/smart-contracts/confidential-asset.mdx | Major rewrite of protocol/storage/balance explanations and entry/view function docs. |
| src/content/docs/build/sdks/ts-sdk/confidential-asset.mdx | Rewritten SDK guide with new install/init and high-level usage examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ## Confidential Asset Store | ||
| ## Confidential Store | ||
|
|
||
| For every confidential asset a user registers, they generate a unique keypair: |
There was a problem hiding this comment.
The term “confidential asset” here reads like a specific token instance, but the rest of this doc (and the APIs below) use “asset type”. Consider rewording to “For every asset type a user registers…” for consistency and to reduce ambiguity.
| For every confidential asset a user registers, they generate a unique keypair: | |
| For every asset type a user registers, they generate a unique keypair: |
| This mechanism is automatically applied to the available balance after each transfer or withdrawal, | ||
| ensuring that users can always decrypt their balances, even as balances grow through multiple transactions. | ||
| Only after a rollover, users are required to normalize the actual balance [manually](#normalization). | ||
| Only after a rollover, users are required to normalize the available balance [manually](#normalize). |
There was a problem hiding this comment.
The normalization guidance is internally inconsistent: here it says users must normalize manually after a rollover, but later the Rollover/Normalize sections state the available balance must be normalized before rollover (and that normalization is needed only before rollover). Please clarify when manual normalization is required and align the wording in these sections accordingly.
| Only after a rollover, users are required to normalize the available balance [manually](#normalize). | |
| Users are only required to normalize the available balance [manually](#normalize) before a rollover. |
| // The rollover function is the only function that requires the actual balance to be normalized | ||
| // beforehand and leaves it unnormalized after execution, no matter what the pending balance was. | ||
| confidential_asset::rollover_pending_balance(bob, token); | ||
| There are three types of auditors: |
There was a problem hiding this comment.
This says “There are three types of auditors”, but the list below includes four bullets (global, asset-specific, effective, voluntary). Please fix the count or restructure (e.g., treat “effective auditor” as a derived concept rather than an additional type).
| Although it is recommended to generate a unique keypair for each token to enhance security, | ||
| it's not restricted to reuse the same encryption key across multiple tokens if preferred. | ||
| Although it is recommended to generate a unique keypair for each asset type to enhance security, | ||
| it's not restricted to reuse the same encryption key across multiple assets if preferred. |
There was a problem hiding this comment.
Minor grammar: “it's not restricted to reuse the same encryption key…” is ungrammatical. Consider rephrasing to “it’s not restricted to reuse/reuse” → “it’s not restricted from reusing the same encryption key…” (or similar).
| it's not restricted to reuse the same encryption key across multiple assets if preferred. | |
| users are not restricted from reusing the same encryption key across multiple assets if preferred. |
| return result | ||
| }) | ||
| } | ||
| await initializeWasm(); |
There was a problem hiding this comment.
This snippet uses top-level await initializeWasm(). That only works in ESM contexts (and not in many common TS/Node/CommonJS setups). Consider wrapping this in an async init function (or explicitly calling out the ESM/top-level-await requirement) to prevent copy/paste breakage.
| await initializeWasm(); | |
| async function initConfidentialAssets() { | |
| await initializeWasm(); | |
| } | |
| initConfidentialAssets(); |
60595c6 to
9225bcc
Compare
alinush
left a comment
There was a problem hiding this comment.
I spoke to @gregnazario and will go with his recommendations:
- rename
AccountBlobtoEncryptedDKand keep in account.move - move the new
upsert_ed25519_*to account.move - keep the
register_ek_and_encrypt_dkin keyless_account.move
|
@cursoragent please re-evaluate whatever has been done here against the latest confidential assets SDK, and correct it accordingly |
|
Here is what I verified and what I changed. Verification (SDK + framework)
Updates
Committed as Note: |
Clarify normalization vs rollover, auditor roles, and emergency pause coverage in the Move reference. Tighten TypeScript guide against @aptos-labs/confidential-asset 1.1.x (install range, transaction builder vs high-level client, rotation flags).
|
@gregnazario i am rewriting the docs myself. Sorry. Should've posted an update. |


Note: Claude re-did the docs & I have not validated them.
TODO:
[Compressed]Balancerefactor withenumand phantom types & then rebase