Charms
Overview
Integrate and operate Charms for programmable Bitcoin assets. Use this skill when a task requires Charms app development, spell creation and proof generation, commit and spell transaction submission, spell inspection on existing transactions, wallet charm inventory, or API and wallet integration.
Environment
- Requires
bash, curl, and jq.
- Requires
charms CLI.
- For app development, requires Rust and
wasm32-wasip1 target.
- For Bitcoin casting and wallet flows, requires
bitcoin-cli connected to a node (testnet4 for quick iteration).
Use this skill for concrete implementation and operations, not generic protocol theory.
Workflow
- Pick the execution path first:
- App and spell lifecycle (new app, build, verify key, check, prove, submit).
- Spell schema and validation debugging.
- Wallet and API integration (
wallet list, tx show-spell, server endpoint).
- Run preflight checks:
scripts/check-charms-prereqs.sh app
scripts/check-charms-prereqs.sh spell
scripts/check-charms-prereqs.sh wallet
scripts/check-charms-prereqs.sh server
- For app and spell operations, follow app-and-spell-workflow:
- Scaffold app with
charms app new.
- Build and derive app verification key.
- Validate spells with
charms spell check.
- Produce package-ready transactions with
charms spell prove.
- For schema and validation issues, use spell-format-and-validation:
- Confirm app identifiers and VKs.
- Confirm
ins and outs line up with transaction reality.
- Keep private inputs off-chain and pass them through the private input file path.
- For wallet and API surfaces, use wallet-and-server-integration:
- Inspect wallets for charm-bearing outputs.
- Decode spell content from known transactions.
- Run
charms server and call /spells/prove in JSON or CBOR mode.
- Apply execution safety constraints:
- Use low-value UTXOs and testnet4 while iterating.
- Never submit package transactions before validating both commit and spell tx hex.
- Keep prover and wallet secrets out of logs and source control.
Quick Commands
# App scaffold and build
charms app new my-token
cd my-token
app_bin="$(charms app build)"
charms app vk "$app_bin"
# Spell validation and proving
cat ./spells/mint-nft.yaml | envsubst | charms spell check --app-bins="$app_bin" --prev-txs="$prev_txs"
cat ./spells/mint-nft.yaml | envsubst | charms spell prove --app-bins="$app_bin" --prev-txs="$prev_txs" --funding-utxo="$funding_utxo" --funding-utxo-value="$funding_utxo_value" --change-address="$change_address"
# Wallet and tx inspection
charms wallet list --json
charms tx show-spell --chain bitcoin --tx "$tx_hex" --json
# API server
charms server --ip 0.0.0.0 --port 17784
Reference Files
- app-and-spell-workflow: end-to-end app scaffold, check, prove, sign, and package submission.
- spell-format-and-validation: spell fields, app mapping, proof and version checks, and frequent failure modes.
- wallet-and-server-integration: wallet parsing, tx inspection, API server usage, and wallet UI integration path.
1---2name: charms3description: Charms workflows for Bitcoin app contracts, spell proving, and UTXO asset operations.4---56# Charms78## Overview910Integrate and operate Charms for programmable Bitcoin assets. Use this skill when a task requires Charms app development, spell creation and proof generation, commit and spell transaction submission, spell inspection on existing transactions, wallet charm inventory, or API and wallet integration.1112## Environment1314- Requires `bash`, `curl`, and `jq`.15- Requires `charms` CLI.16- For app development, requires Rust and `wasm32-wasip1` target.17- For Bitcoin casting and wallet flows, requires `bitcoin-cli` connected to a node (testnet4 for quick iteration).1819Use this skill for concrete implementation and operations, not generic protocol theory.2021## Workflow22231. Pick the execution path first:24- App and spell lifecycle (new app, build, verify key, check, prove, submit).25- Spell schema and validation debugging.26- Wallet and API integration (`wallet list`, `tx show-spell`, `server` endpoint).27282. Run preflight checks:29- `scripts/check-charms-prereqs.sh app`30- `scripts/check-charms-prereqs.sh spell`31- `scripts/check-charms-prereqs.sh wallet`32- `scripts/check-charms-prereqs.sh server`33343. For app and spell operations, follow [app-and-spell-workflow](references/app-and-spell-workflow.md):35- Scaffold app with `charms app new`.36- Build and derive app verification key.37- Validate spells with `charms spell check`.38- Produce package-ready transactions with `charms spell prove`.39404. For schema and validation issues, use [spell-format-and-validation](references/spell-format-and-validation.md):41- Confirm app identifiers and VKs.42- Confirm `ins` and `outs` line up with transaction reality.43- Keep private inputs off-chain and pass them through the private input file path.44455. For wallet and API surfaces, use [wallet-and-server-integration](references/wallet-and-server-integration.md):46- Inspect wallets for charm-bearing outputs.47- Decode spell content from known transactions.48- Run `charms server` and call `/spells/prove` in JSON or CBOR mode.49506. Apply execution safety constraints:51- Use low-value UTXOs and testnet4 while iterating.52- Never submit package transactions before validating both commit and spell tx hex.53- Keep prover and wallet secrets out of logs and source control.5455## Quick Commands5657```bash58# App scaffold and build59charms app new my-token60cd my-token61app_bin="$(charms app build)"62charms app vk "$app_bin"6364# Spell validation and proving65cat ./spells/mint-nft.yaml | envsubst | charms spell check --app-bins="$app_bin" --prev-txs="$prev_txs"66cat ./spells/mint-nft.yaml | envsubst | charms spell prove --app-bins="$app_bin" --prev-txs="$prev_txs" --funding-utxo="$funding_utxo" --funding-utxo-value="$funding_utxo_value" --change-address="$change_address"6768# Wallet and tx inspection69charms wallet list --json70charms tx show-spell --chain bitcoin --tx "$tx_hex" --json7172# API server73charms server --ip 0.0.0.0 --port 1778474```7576## Reference Files7778- [app-and-spell-workflow](references/app-and-spell-workflow.md): end-to-end app scaffold, check, prove, sign, and package submission.79- [spell-format-and-validation](references/spell-format-and-validation.md): spell fields, app mapping, proof and version checks, and frequent failure modes.80- [wallet-and-server-integration](references/wallet-and-server-integration.md): wallet parsing, tx inspection, API server usage, and wallet UI integration path.