# IBC Token Factory

`IBC Token Factory` represents a collection configured with Cosmos Coin wrapper paths (`cosmosCoinWrapperPaths`) that convert collection token balances 1:1 (or at a configured ratio) into native chain coins (`badges:<collectionId>:<denom>`). Those wrapped coins can be held in `x/bank`, traded on the DEX, and transferred over IBC.

Unlike [Smart Tokens](https://docs.bitbadges.io/standards/smart-tokens) (which lock an existing external coin such as USDC behind `cosmosCoinBackedPath`), an IBC Token Factory wrapper mints and burns a chain denomination backed by the collection's own tokens.

## CLI Commands

There is no dedicated one-shot `bb build ibc-token` constructor; create IBC Token Factory collections with the frontend `/mint/ibc-token` flow or session tools (`add_cosmos_wrapper_path`). Use `bb ibc-token` (alias `bb ibc-tokens`) to inspect wrapper paths and build unsigned wrap or unwrap transfers:

```bash
bb ibc-token show "$COLLECTION_ID"
bb ibc-token status "$COLLECTION_ID"

bb ibc-token wrap "$COLLECTION_ID" --creator "$HOLDER" --amount 10
bb ibc-token wrap "$COLLECTION_ID" --creator "$HOLDER" --amount 1000000 --base-units --denom umytoken
bb ibc-token unwrap "$COLLECTION_ID" --creator "$HOLDER" --amount 5
```

All mutating commands emit unsigned `MsgTransferTokens` proposals by default. Pipe into `bb deploy` or pass `--browser` / `--with-keyring` explicitly.

| Command | Description | Emits |
| --- | --- | --- |
| `bb ibc-token show <id>` | Full inspection: wrapper paths, full Cosmos denoms (`badges:<id>:<denom>`), derived alias addresses, decimals, wrap/unwrap approvals, authority | Read-only |
| `bb ibc-token status <id>` | Compact status summary with wrapper denoms, full denoms, actions, issues, and warnings | Read-only |
| `bb ibc-token wrap <id>` | Transfer collection tokens to the wrapper alias address to mint wrapped Cosmos coins (`--creator`, `--amount`, optional `--denom`, `--token-id`, `--base-units`, `--approval-id`) | `MsgTransferTokens` |
| `bb ibc-token unwrap <id>` | Transfer collection tokens from the wrapper alias address back to the holder to burn wrapped Cosmos coins (`--creator`, `--amount`, optional `--denom`, `--token-id`, `--base-units`, `--approval-id`) | `MsgTransferTokens` |

`--amount` uses the selected wrapper path's default display decimals unless `--base-units` is passed. When a collection defines multiple wrapper paths, pass `--denom` (matching `denom`, `fullDenom`, or `symbol`) explicitly. When multiple wrap or unwrap approvals exist, pass `--approval-id` explicitly.

## MCP Tools and SDK Functions

Shared MCP tools mirror every `bb ibc-token` action without signing or broadcasting:

- `standard_ibc_token_show` — inspect wrapper paths, full denoms, and approvals
- `standard_ibc_token_status` — compact IBC Token Factory status summary
- `standard_ibc_token_wrap` — build an unsigned wrap `MsgTransferTokens` proposal
- `standard_ibc_token_unwrap` — build an unsigned unwrap `MsgTransferTokens` proposal

Inspect exact input schemas with `bb dev capabilities standard_ibc_token_wrap` or the [Capability Catalog](https://docs.bitbadges.io/agents/capabilities).

SDK core functions (`bitbadges`): `inspectIbcTokenCollection`, `validateIbcTokenCollection`, `doesCollectionFollowIbcTokenProtocol`, `selectIbcWrapperPath`, `selectIbcWrapperApproval`, `resolveIbcTokenAmount`, `buildIbcTokenWrapMsg`, and `buildIbcTokenUnwrapMsg`.

## Configuration and Caveats

Wrap and unwrap approvals must set `allowSpecialWrapping: true` in `approvalCriteria` and allow transfers to/from the wrapper path's deterministic alias address (derived via `generateAliasAddressForDenom(denom)`).

The following **field fragment** identifies the standard capability; a complete collection also requires `cosmosCoinWrapperPaths` and matching wrap/unwrap approvals:

```json
{
  "standards": ["IBC Token Factory"],
  "validTokenIds": [{ "start": "1", "end": "1" }],
  "invariants": { "allowSpecialWrapping": true }
}
```

- **Denomination identity**: A display symbol is not a unique denomination identifier. Reconcile wrapped balances using the full `badges:<collectionId>:<denom>` denom in `x/bank` alongside the collection token balance.
- **External IBC state**: Having a valid wrapper path does not establish that an IBC channel is active or that a remote chain has registered the denomination.
- **Bounded inspection**: `show` and `status` report `eligibility: "not-checked"` and list any `overrideApprovalIds` on the collection. Verify live balances, channels, and approval trackers before signing.

## Related

- [Smart Tokens](https://docs.bitbadges.io/standards/smart-tokens#ibc-token-factory)
- [Cosmos Coin Wrapper Paths](https://docs.bitbadges.io/token-standard/ibc/cosmos-coin-wrapper-paths)
- [Wrap to an IBC Denom guide](https://docs.bitbadges.io/guides/wrap-to-an-ibc-denom)
- [CLI Standards Commands](https://docs.bitbadges.io/cli/standards#ibc-token)
- [Standards Tooling](https://docs.bitbadges.io/standards/tooling)
