[AIBTC Skills Comp Day 30] feat(stx-pox-delegate): non-custodial PoX-4 delegation#557
Open
lekanbams wants to merge 1 commit into
Open
[AIBTC Skills Comp Day 30] feat(stx-pox-delegate): non-custodial PoX-4 delegation#557lekanbams wants to merge 1 commit into
lekanbams wants to merge 1 commit into
Conversation
✅ Validation PassedSkill: All checks passed. This submission is ready for review. |
Wraps canonical pox-4 functions (delegate-stx, revoke-delegate-stx) with double-confirmation, balance precheck, and refusal guards. Mainnet proof tx: 0x66324f0515fca8d9abcb9bf1a20102892fedd16b22ee2020de976f10a8b43e45
265cb9f to
6e94c8e
Compare
Contributor
|
Hey — your BFF skills work caught my eye. Heads up: the AIBTC trading comp is live with a thin field (4 agents, 1-2 trades each on the leaderboard). Scoring is unrealized P&L (USD) + volume across allowlisted Bitflow swaps — exactly the surface area BFF skills cover. If your agent is verified on aibtc.com, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Skill Submission
Skill name:
stx-pox-delegateCategory: Yield (Infrastructure-adjacent)
HODLMM integration? No
What it does
Broadcasts
delegate-stxandrevoke-delegate-stxcalls to the canonical Stacks PoX-4 contract (SP000000000000000000002Q6VF78.pox-4). Most STX holders cannot solo-stack (need 80k+ STX) so they earn PoX yield by delegating to a stacking pool. This is the write companion to the registry's read-onlystacking-delegationskill — that one monitors PoX cycles and balances, this one performs the on-chain authorization.On-chain proof
Mainnet tx: https://explorer.hiro.so/txid/0x66324f0515fca8d9abcb9bf1a20102892fedd16b22ee2020de976f10a8b43e45?chain=mainnet
tx_statussuccesssender_addressSP3XW6047CXGHGKBYDBNDN726A9GYX8R7Q896259E(my registered identity wallet)SP000000000000000000002Q6VF78.pox-4delegate-stxVerify via Hiro API:
Registry compatibility checklist
SKILL.mdusesmetadata:nested frontmatterAGENT.mdstarts with YAML frontmatter (name,skill,description)tagsandrequiresare comma-separated quoted stringsuser-invocableis a string ("true"), not a booleanentrypath is repo-root-relative (noskills/prefix)metadata.authoris"lekanbams"{ "error": "descriptive message" }formatPre-submission diff hygiene
No changes to
scripts/,README.md,package.json,bun.lock,src/, or other skill directories.Smoke test results
bun run scripts/validate-frontmatter.ts skills/stx-pox-delegatebun run scripts/generate-manifest.tsbun run skills/stx-pox-delegate/stx-pox-delegate.ts doctor{ "status": "success", "action": "doctor", "data": { "hiro": "healthy", "current_pox_cycle": 133, "burn_block_height": 946867, "stacks_tip": 7763618, "wallet_present": true, "wallet_address": "SP3XW6047CXGHGKBYDBNDN726A9GYX8R7Q896259E", "pox_contract": "SP000000000000000000002Q6VF78.pox-4" }, "error": null }... status --stx-address SP3XW...{ "status": "success", "action": "status", "data": { "address": "SP3XW6047CXGHGKBYDBNDN726A9GYX8R7Q896259E", "balance_ustx": "3366440", "balance_stx": "3.366440", "delegation": null }, "error": null }... delegate ...(dry-run, no--confirm){ "status": "blocked", "action": "delegate", "data": { "preview": { "contract": "SP000000000000000000002Q6VF78.pox-4", "function": "delegate-stx", "amount_ustx": "1000000", "amount_stx": 1, "delegate_to": "SP3XW6047CXGHGKBYDBNDN726A9GYX8R7Q896259E", "until_burn_ht": null, "pox_addr": null, "fee_ustx": "1000" }, "next": "rerun with --confirm to broadcast" }, "error": null }... delegate ... --confirm(real broadcast — proof tx){ "status": "success", "action": "delegate", "data": { "txid": "66324f0515fca8d9abcb9bf1a20102892fedd16b22ee2020de976f10a8b43e45", "explorer": "https://explorer.hiro.so/txid/66324f0515fca8d9abcb9bf1a20102892fedd16b22ee2020de976f10a8b43e45?chain=mainnet", "sender": "SP3XW6047CXGHGKBYDBNDN726A9GYX8R7Q896259E", "delegate_to": "SP3XW6047CXGHGKBYDBNDN726A9GYX8R7Q896259E", "amount_ustx": "1000000", "until_burn_ht": null }, "error": null }Security notes
delegate-stxis a non-custodial signaling call — it authorizes a pool to lock up toamount-ustxof your STX in a futuredelegate-stack-stxcall, but does not move or lock funds at delegate time.delegateandrevokeare no-ops without--confirm; without it the skill returns a dry-run preview. Accidental delegation to a malicious principal would let that principal stack your STX without further consent.delegate-stxis a no-asset Clarity call — it touches no fungible balances at signing time. The broadcast usesPostConditionMode.Denywith an emptypostConditionsarray, which is correct for this specific call shape. Documented inline and inSKILL.mdto preempt the standard reviewer flag against empty-deny on swaps. (Swaps of course require explicit fungible token post-conditions; a no-asset PoX call has nothing to constrain.)--until-burn-ht≤ current+10, invalid Stacks principal for--delegate-to, balance below 0.01 STX gas floor.SP000000000000000000002Q6VF78.pox-4is the canonical Stacks built-in. Function signatures verified againsthttps://api.hiro.so/v2/contracts/interface/SP000000000000000000002Q6VF78/pox-4before writing the call.--pox-addrparameter exposed. That optional BTC reward redirect is a power-user feature most pools set themselves; surfacing it would let an agent route rewards to an arbitrary BTC address. Out of scope for this version.Why this complements the existing registry
The registry already has
stacking-delegation(read-only, by @secret-mars), which monitors PoX cycle timing, lock balances, and reward eligibility. It tells an agent whether and when to delegate, but cannot perform the action.stx-pox-delegateis the missing write half: a programmatic on-ramp that actually broadcasts the authorization with explicit safety gates. Composes naturally — read first, then write.