cardano-cli-transactions-operator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cardano-cli-transactions-operator

cardano-cli-transactions-operator

OPERATOR SKILL: This skill executes commands including transaction submission. Requires explicit human invocation.
OPERATOR SKILL: 此技能可执行包括交易提交在内的命令。需要明确的人工调用。

When to use

适用场景

  • When ready to build and submit a transaction
  • After reviewing guidance from
    cardano-cli-transactions
  • 准备好构建并提交交易时
  • 在查看
    cardano-cli-transactions
    提供的指导之后

Operating rules (must follow)

操作规则(必须遵守)

  • Confirm network before ANY operation
  • Show full transaction details before signing
  • REQUIRE explicit "yes" confirmation before submit
  • Create tx bundle folder for reproducibility
  • Verify UTxO changes after submit
  • 任何操作前先确认网络
  • 签名前显示完整交易详情
  • 提交前必须获得明确的“yes”确认
  • 创建交易包文件夹以确保可复现性
  • 提交后验证UTxO变化

Pre-flight checklist

预执行检查清单

[ ] Network confirmed: ___________
[ ] Sender address verified
[ ] Recipient address verified (check first/last 8 chars)
[ ] Amount confirmed: ___________ lovelace
[ ] Signing key path confirmed
[ ] UTxO inputs selected
[ ] 已确认网络: ___________
[ ] 已验证发送方地址
[ ] 已验证接收方地址(检查首尾8个字符)
[ ] 已确认金额: ___________ lovelace
[ ] 已确认签名密钥路径
[ ] 已选择UTxO输入

Execution workflow

执行流程

Step 1: Setup tx bundle

步骤1:设置交易包

bash
TX_DIR="tx-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$TX_DIR" && cd "$TX_DIR"
bash
TX_DIR="tx-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$TX_DIR" && cd "$TX_DIR"

Step 2: Query UTxOs

步骤2:查询UTxO

bash
cardano-cli conway query utxo \
  --address <sender-addr> \
  --testnet-magic 1 \
  --out-file utxos.json
bash
cardano-cli conway query utxo \
  --address <sender-addr> \
  --testnet-magic 1 \
  --out-file utxos.json

Step 3: Fetch protocol parameters

步骤3:获取协议参数

bash
cardano-cli conway query protocol-parameters \
  --testnet-magic 1 \
  --out-file pparams.json
bash
cardano-cli conway query protocol-parameters \
  --testnet-magic 1 \
  --out-file pparams.json

Step 4: Build transaction

步骤4:构建交易

bash
cardano-cli conway transaction build \
  --testnet-magic 1 \
  --tx-in <utxo>#<index> \
  --tx-out <recipient>+<amount> \
  --change-address <sender> \
  --out-file tx.unsigned
bash
cardano-cli conway transaction build \
  --testnet-magic 1 \
  --tx-in <utxo>#<index> \
  --tx-out <recipient>+<amount> \
  --change-address <sender> \
  --out-file tx.unsigned

Step 5: Sign (show what's being signed)

步骤5:签名(显示待签名内容)

bash
echo "=== SIGNING TRANSACTION ==="
echo "Inputs: <utxo>"
echo "Output: <recipient> receives <amount> lovelace"
echo "Change: returns to <sender>"

cardano-cli conway transaction sign \
  --tx-file tx.unsigned \
  --signing-key-file <payment.skey> \
  --testnet-magic 1 \
  --out-file tx.signed
bash
echo "=== 正在签名交易 ==="
echo "输入: <utxo>"
echo "输出: <recipient> 接收 <amount> lovelace"
echo "找零: 返回至 <sender>"

cardano-cli conway transaction sign \
  --tx-file tx.unsigned \
  --signing-key-file <payment.skey> \
  --testnet-magic 1 \
  --out-file tx.signed

Step 6: Submit (REQUIRES CONFIRMATION)

步骤6:提交(需要确认)

⚠️  CONFIRM SUBMISSION ⚠️
Network: preprod
Sending: X ADA to addr_test1...
From: addr_test1...

Type 'yes' to submit:
bash
cardano-cli conway transaction submit \
  --testnet-magic 1 \
  --tx-file tx.signed
⚠️  确认提交 ⚠️
网络: preprod
发送: X ADA 至 addr_test1...
来自: addr_test1...

输入'yes'以提交:
bash
cardano-cli conway transaction submit \
  --testnet-magic 1 \
  --tx-file tx.signed

Step 7: Verify

步骤7:验证

bash
undefined
bash
undefined

Get tx hash

获取交易哈希

cardano-cli conway transaction txid --tx-file tx.signed
cardano-cli conway transaction txid --tx-file tx.signed

Query recipient UTxO

查询接收方UTxO

cardano-cli conway query utxo
--address <recipient>
--testnet-magic 1
undefined
cardano-cli conway query utxo
--address <recipient>
--testnet-magic 1
undefined

Safety / key handling

安全/密钥处理

  • Never submit without explicit user confirmation
  • For mainnet: require double confirmation
  • Keep tx bundle for audit trail
  • Recommend small test tx first on mainnet
  • 未经用户明确确认绝不要提交
  • 主网环境:需要双重确认
  • 保留交易包用于审计追踪
  • 建议在主网先进行小额测试交易

References

参考资料

  • cardano-cli-transactions
    (guidance skill)
  • shared/PRINCIPLES.md
  • cardano-cli-transactions
    (指导技能)
  • shared/PRINCIPLES.md