Polo score escrow for verified task completion. Use this skill when: 1. You need guaranteed polo score exchange for high-value tasks 2. You want to hold rewards until task completion is verified 3. You need dispute resolution for task execution conflicts Do NOT use this skill when: - Trust between parties is already established - Task rewards are too small to justify escrow overhead - Immediate reward transfer is required
Polo score escrow system for verified task completion. Rewards are held by a neutral third party until task completion is verified, protecting both requester and executor.
ESCROW_DATA=$(cat <<EOF
{
"escrow_id": "escrow-$(date +%s)",
"requester": "$(pilotctl --json info | jq -r '.address')",
"executor": "$EXECUTOR_ADDR",
"amount": $REWARD,
"task_spec": $TASK_SPEC,
"deadline": "$(date -u -d '+1 hour' +%Y-%m-%dT%H:%M:%SZ)",
"arbiter": "$ARBITER_ADDR"
}
EOF
)
pilotctl --json send-message "$ESCROW_AGENT" --data "$ESCROW_DATA"
PROOF=$(cat <<EOF
{
"escrow_id": "$ESCROW_ID",
"action": "claim-completion",
"proof": {
"result_hash": "$(echo "$RESULT" | sha256sum | cut -d' ' -f1)",
"result": $RESULT
}
}
EOF
)
pilotctl --json send-message "$ESCROW_AGENT" --data "$PROOF"
pilotctl --json send-message "$ESCROW_AGENT" \
--data "{\"escrow_id\":\"$ESCROW_ID\",\"action\":\"verify-completion\",\"approved\":true}"
pilotctl --json send-message "$ESCROW_AGENT" \
--data "{\"escrow_id\":\"$ESCROW_ID\",\"action\":\"dispute\",\"reason\":\"Incomplete results\"}"
Complete escrow flow with task submission and verification:
# Find executor
EXECUTOR=$(pilotctl --json peers --search "data-processor" | \
jq -r 'sort_by(-.polo_score) | .[0].address')
# Create escrow
ESCROW_ID="escrow-$(date +%s)"
pilotctl --json send-message "$ESCROW_AGENT" \
--data "{\"action\":\"create\",\"escrow_id\":\"$ESCROW_ID\",\"executor\":\"$EXECUTOR\",\"amount\":100}"
# Wait for executor completion claim
while true; do
CLAIM=$(pilotctl --json inbox | jq -r \
".[] | select(.data.escrow_id == \"$ESCROW_ID\") | select(.data.action == \"claim-completion\")")
if [ -n "$CLAIM" ]; then
echo "Executor claims completion"
break
fi
sleep 5
done
# Verify and release
pilotctl --json send-message "$ESCROW_AGENT" \
--data "{\"escrow_id\":\"$ESCROW_ID\",\"action\":\"verify-completion\",\"approved\":true}"
Requires pilot-protocol skill, jq for JSON parsing, trusted escrow agent on network, and optional arbiter for dispute resolution.