ワンクリックで
analyze-protocol
Analyze a Cardano protocol on-chain and implement it as a tx3 protocol with invoke-args and comparison report
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Analyze a Cardano protocol on-chain and implement it as a tx3 protocol with invoke-args and comparison report
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | analyze-protocol |
| description | Analyze a Cardano protocol on-chain and implement it as a tx3 protocol with invoke-args and comparison report |
Analyze the on-chain protocol and implement it as a tx3 protocol.
Arguments provided: $ARGUMENTS
protocols_tx3/<name>/ already exists with a scaffold (main.tx3, trix.toml). If so, read the existing files to understand what's already been done.investigation/ folder with prior research — build on it rather than starting from scratch.Use the Koios REST API (https://api.koios.rest/api/v1/) to investigate the protocol.
Starting from the provided address or policy ID:
POST https://api.koios.rest/api/v1/address_info
POST https://api.koios.rest/api/v1/address_assets
POST https://api.koios.rest/api/v1/address_utxos (with _extended: true for reference scripts)
Find:
Find recent transactions for the protocol:
POST https://api.koios.rest/api/v1/address_txs
POST https://api.koios.rest/api/v1/asset_txs (for tokens)
POST https://api.koios.rest/api/v1/asset_history (for minting events)
For each transaction type found:
POST https://api.koios.rest/api/v1/tx_info
POST https://api.koios.rest/api/v1/tx_cbor
Extract and document:
For each inline datum found, decode the CBOR and identify:
Document findings in protocols_tx3/$0/investigation/.
Separate protocol configuration into layers:
| Layer | Description | Where it goes in tx3 |
|---|---|---|
| Constants | Same across all instances (token names, fixed strings) | env {} block |
| Instance-level | Shared across all markets/pools in one deployment | env {} or parties in .env.mainnet |
| Per-market/pool | Changes for each market, pool, or user interaction | tx params (JSON args) |
| Per-call | User address, amounts, prices | tx params (JSON args) |
mkdir -p protocols_tx3/$0/{invoke-args,investigation}
Create trix.toml:
[protocol]
name = "$0"
scope = ""
version = "0.0.0"
description = ""
main = "main.tx3"
[ledger]
family = "cardano"
Structure the file as:
Known tx3 limitations to account for:
_yes/_no){} required for unit variants (e.g., BuyPos {})VAR="" not VAR=See protocols_tx3/bodega-market/investigation/tx3-custom-types-limitation.md for full details.
Only include values that are truly constant or instance-level. Per-market/per-call values go as tx params.
Party naming convention: PartyName in tx3 → PARTYNAME in .env (uppercase, no underscores added).
Dynamic parties (provided per call) go in JSON args as lowercase: "user": "addr1...".
One JSON per transaction. Include:
"user": "addr1...")cd protocols_tx3/$0
trix check # syntax validation
trix invoke --skip-submit --profile mainnet --args-json-path invoke-args/<tx>.json
For each tx, find a mainnet wallet that currently holds the required assets:
POST https://api.koios.rest/api/v1/address_info
POST https://api.koios.rest/api/v1/address_assets
Requirements:
For each tx:
trix invoke --skip-submit --profile mainnet --args-json-path <args>.jsonPOST https://api.koios.rest/api/v1/tx_cborExpected differences that are NOT errors:
89, 82) vs indefinite-length (9f...ff) — semantically identical--skip-submit produces unsigned txsIf comparison reveals mismatches:
Create invoke-args/comparison-report.md with:
trix build to compile the .tii.tx3/.tii/main.tii to protocols/<protocol-name>.tii# Address info (balance, UTxO count)
curl -X POST https://api.koios.rest/api/v1/address_info \
-H "Content-Type: application/json" \
-d '{"_addresses": ["addr1..."]}'
# Address assets (native tokens)
curl -X POST https://api.koios.rest/api/v1/address_assets \
-H "Content-Type: application/json" \
-d '{"_addresses": ["addr1..."]}'
# Address UTxOs (with reference scripts)
curl -X POST https://api.koios.rest/api/v1/address_utxos \
-H "Content-Type: application/json" \
-d '{"_addresses": ["addr1..."], "_extended": true}'
# Transaction info
curl -X POST https://api.koios.rest/api/v1/tx_info \
-H "Content-Type: application/json" \
-d '{"_tx_hashes": ["txhash..."]}'
# Transaction CBOR
curl -X POST https://api.koios.rest/api/v1/tx_cbor \
-H "Content-Type: application/json" \
-d '{"_tx_hashes": ["txhash..."]}'
# Asset transaction history
curl -X POST https://api.koios.rest/api/v1/asset_txs \
-H "Content-Type: application/json" \
-d '{"_asset_policy": "policy...", "_asset_name": "name..."}'
# Asset mint/burn history
curl -X POST https://api.koios.rest/api/v1/asset_history \
-H "Content-Type: application/json" \
-d '{"_asset_policy": "policy...", "_asset_name": "name..."}'
# Asset holders
curl -X POST https://api.koios.rest/api/v1/asset_addresses \
-H "Content-Type: application/json" \
-d '{"_asset_policy": "policy...", "_asset_name": "name..."}'
# Address transactions (recent activity)
curl -X POST https://api.koios.rest/api/v1/address_txs \
-H "Content-Type: application/json" \
-d '{"_addresses": ["addr1..."], "_after_block_height": 13000000}'