Skip to content

docs(0.14): document native asset vault key/value encoding - #371

Open
kutluhaneth46 wants to merge 2 commits into
0xMiden:mainfrom
kutluhaneth46:cursor/docs-v014-asset-encoding-88c1
Open

docs(0.14): document native asset vault key/value encoding#371
kutluhaneth46 wants to merge 2 commits into
0xMiden:mainfrom
kutluhaneth46:cursor/docs-v014-asset-encoding-88c1

Conversation

@kutluhaneth46

Copy link
Copy Markdown

Summary

  • Fixes Document v0.14 asset encoding in core-concepts/protocol/asset.md #270: documents the v0.14 ASSET_KEY / ASSET_VALUE layout (fungible vs non-fungible, callback flag in faucet_id_suffix) under versioned_docs/version-0.14/reference/protocol/asset.md#encoding.
  • Aligns create_non_fungible_asset Inputs with the fungible helper (enable_callbacks first) in protocol_library.md.
  • Satisfies the existing migration-guide link to #encoding.

Test plan

  • Manual review of the new Encoding section against AssetVaultKey::to_word() on the v0.14.6 tag

Add the ASSET_KEY / ASSET_VALUE layout for fungible and non-fungible
assets, including the callback flag in faucet_id_suffix, and align the
create_non_fungible_asset Inputs row with enable_callbacks.

@BrianSeong99 BrianSeong99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One correctness issue before approval.


| Kind | Value word |
| --- | --- |
| Fungible | `[amount, 0, 0, 0]` — `amount ≤ 2⁶³−1` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The maximum fungible amount in v0.14.6 is 2⁶³−2³¹, not 2⁶³−1. Could we update this row so it matches FungibleAsset::MAX_AMOUNT and FUNGIBLE_ASSET_MAX_AMOUNT?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — updated both places (the vault ASSET_VALUE table row and the earlier fungible-asset prose) to 2⁶³−2³¹, matching FungibleAsset::MAX_AMOUNT / FUNGIBLE_ASSET_MAX_AMOUNT (0x7fffffff80000000).

Align the vault encoding table and fungible asset prose with
FungibleAsset::MAX_AMOUNT / FUNGIBLE_ASSET_MAX_AMOUNT (0x7fffffff80000000).
@kutluhaneth46

Copy link
Copy Markdown
Author

Addressed @BrianSeong99's P1: fungible max amount is now documented as `2⁶³−2³¹` (not `2⁶³−1`) in both the prose and the `ASSET_VALUE` table, matching `FungibleAsset::MAX_AMOUNT` / `FUNGIBLE_ASSET_MAX_AMOUNT`.

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.

Document v0.14 asset encoding in core-concepts/protocol/asset.md

2 participants