Alias Compatibility
In many instances, you may see BitBadges provide alias denomination support for compatibility with existing Cosmos SDK interfaces like sdk.Coin. This enables seamless integration with liquidity pools, multi-standard environments, and other systems that expect standard Cosmos coin formats (denom, amount).
Note that the environment must support aliases for this to work.
Alias Denomination Format
BitBadges uses the format badgeslp:COLLECTION_ID:denom for alias denominations:
Format:
badgeslp:COLLECTION_ID:denomExample:
5 badgeslp:73:utokenCollection ID:
73Base denomination:
utoken(from the collection'saliasPathsarray)Amount:
5
How It Works
The alias denomination converts an integer amount to Balances[] using the collection's aliasPaths field, which defines the conversion rate.
Conversion Process
Parse the alias: Extract collection ID and denom from
badgeslp:COLLECTION_ID:denomFind alias path: Look up the matching
AliasPathin the collection'saliasPathsarray by denomConvert amount: Use the path's
conversionfield to convert the integer amount toBalances[]. The conversion rate is:conversion.sideA.amountalias units =conversion.sideB[]tokens. For example, ifsideA.amount = "1"andsideB = [{ amount: 1n, ... }], then1 badgeslp:73:utoken = 1 token(1:1 conversion)Execute transfer: Process the transfer using the converted
Balances[]viaMsgTransferTokens
Important Notes
No wrapping involved: This is not a wrapping/unwrapping process. The conversion is simply an alias for the full
Balances[]field.Conversion rate defined: The conversion rate is defined in the collection's
aliasPathsfield, specifically in theconversion.sideA.amountandconversion.sideB[]fields of each path.Auto-scan mode: Implementations that support alias denominations almost always operate in auto-scan mode (no prioritized approvals required).
Use Cases
Liquidity Pool Environments
Alias denominations enable BitBadges tokens to participate in liquidity pools that expect standard sdk.Coin formats:
Multi-Standard Support
In environments where you need to support multiple token standards, alias denominations provide a unified interface:
Configuration
The conversion is defined in the collection's aliasPaths field:
Metadata: Alias paths use the standard metadata structure with uri (e.g., ipfs://Qm...) pointing to hosted JSON containing { name, image, description }. The image is the primary use case. The on-chain symbol field is typically used for identification, not the metadata name.
In this example:
1 badgeslp:COLLECTION_ID:utokenconverts to1token with IDs1-100and full ownership timesThe conversion rate is
1:1(1 alias unit = 1 token) becauseconversion.sideA.amount = "1"andconversion.sideB[0].amount = 1nThe conversion structure uses
ConversionWithoutDenombecause the denom is stored separately at the path level
Permission Control
Adding new alias paths to a collection is controlled by the canAddMoreAliasPaths permission. This permission allows you to control when managers can add new alias paths.
Default Behavior
Empty/Nil Permissions: When
canAddMoreAliasPathsis empty or nil, adding paths is allowed (neutral state)Migration: Collections migrated from v21 will have empty permissions, meaning adding paths is allowed by default
Permission Structure
The permission uses the ActionPermission type with time-based controls:
Usage Examples
Allow adding paths at all times:
Lock adding paths forever:
Allow adding paths only during specific period:
Permission Check
When using MsgUniversalUpdateCollection to add alias paths via aliasPathsToAdd, the system checks the canAddMoreAliasPaths permission before processing the paths. If the permission check fails, the transaction will be rejected with an appropriate error message.
Note: The permission is checked before paths are added, but the permission itself can be updated at the end of the transaction (if updateCollectionPermissions is set to true).
Benefits
Drop-In Replacement: Upgrade existing systems to support BitBadges tokens with simply changing a line of code
Seamless Integration: Works with existing Cosmos SDK interfaces and tools
Liquidity Pool Compatibility: Enables participation in AMM pools and DeFi protocols
Multi-Standard Support: Unified interface for different token types
No Wrapping Overhead: Direct alias conversion without minting/burning
Last updated