Skip to content

Conversation

@whoabuddy
Copy link

Summary

This PR adds a comprehensive CAIP-19 specification for Stacks token assets, addressing the feedback from #68.

  • Adds stacks/caip19.md with support for SIP-010 (fungible) and SIP-009 (non-fungible) tokens
  • Updates stacks/README.md to reference CAIP-19

Relationship to #68

This is an updated implementation that addresses all review feedback from #68:

Original Concern Resolution
Undocumented .contract syntax Clear explanation of three components: {address}.{contract}.{token-name}
Incomplete documentation Complete Rationale, Syntax, RegEx, Semantics, Examples sections
Case sensitivity Dedicated subsection explaining address normalization vs case-sensitive contract/token names

Key Design Decisions

Asset Reference Format:

{address}.{contract}.{token-name}
  • Uses . as separator (CAIP-19 compliant, since : is not permitted in asset_reference)
  • Includes token name for precise identification (Stacks contracts can define multiple tokens)
  • Documents relationship to Clarity's native :: syntax

Namespaces:

Namespace Description
sip010 Fungible tokens (SIP-010, analogous to ERC-20)
sip009 Non-fungible tokens (SIP-009, analogous to ERC-721)

Examples (verified on-chain):

# sBTC fungible token
stacks:1/sip010:SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token.sbtc-token

# Megapont Ape Club NFT #4
stacks:1/sip009:SP3D6PV2ACBPEKYJTCMH7HEN02KP87QSP8KTEH335.megapont-ape-club-nft.Megapont-Ape-Club/4

Test plan

  • Syntax follows CAIP-19 specification (no colons in asset_reference)
  • Examples verified against Hiro API for on-chain accuracy
  • Asset reference lengths within 128 character limit
  • All reference links valid

References

🤖 Generated with Claude Code

Adds comprehensive CAIP-19 specification for Stacks token assets,
supporting SIP-010 fungible tokens and SIP-009 non-fungible tokens.

Asset reference format: {address}.{contract}.{token-name}

This addresses the feedback from PR ChainAgnostic#68 including:
- Clear documentation of all syntax components
- Case sensitivity handling (addresses vs contract/token names)
- Complete RegEx validation patterns
- Semantics section for each token type

Examples verified against on-chain data (sBTC, Megapont Ape Club).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@whoabuddy
Copy link
Author

cc @kyranjamie as well!

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.

1 participant