[Discussion] Retroactive Big Tipper: xcm-lens v0.0.2 — XCM debugging toolkit (136 tests, MIT)

Retroactive Big Tipper: xcm-lens v0.0.2 — XCM debugging toolkit

[Disclosure (added Day 2 after community feedback): This proposal was AI-orchestrated. Claude (Anthropic) assisted with: TypeScript boilerplate, long-form prose, and code edits driven by adversarial multi-agent review. I made architectural decisions, ran the review process, and applied the findings. The original ask of 800 DOT was priced as fully-human work and has been adjusted to 400 DOT to reflect AI amplification. Full breakdown in the reply thread.]

Hello Polkadot community :waving_hand:

I’d like to discuss a retroactive Big Tipper for xcm-lens v0.0.2 — an XCM debugging toolkit (TypeScript CLI + library) that I shipped over the past 4 days. The artifact is already live and reviewable on GitHub before any funding ask: 136 tests passing, 5/5 build vectors green, MIT licensed, no upstream merge dependencies.

This post opens a 7-day community discussion. If the feedback is constructive, I plan to submit an on-chain referendum next week.

TL;DR

  • What: CLI + library that turns a high-level intent (“teleport DOT from AH to Bridge Hub for Alice”) into the right post-AHM extrinsic, dry-runs it, surfaces real XcmPaymentApi fees, and explains each instruction.
  • Why: XCM is consistently the #1 developer friction point. Existing tools cover chain state OR scaffold projects — none address the construct-simulate-explain loop.
  • Status: v0.0.2 shipped, public, working. Two adversarial code review passes closed (Wednesday: 6 critical + 4 major; Thursday: 5 critical + 7 major findings) before this submission.
  • Ask: 800 DOT (~$5,200 at current DOT price) retroactive Big Tipper. Solo-dev, ~4 days of focused work.
  • Precedent: ref #1340 (PVM Debugger) — 100% Aye, $16K USDT, almost identical profile.

What ships in v0.0.2

Repo · Release notes · STATUS.md

Two TypeScript packages + CLI:

@xcm-lens/core (PAPI-free)

  • IntentSchema v1 — frozen Zod schema with semver-aware versioning, schema-level invariants (Parachain only at interior[0], fee asset must equal action asset, u64 weights).
  • buildFromIntent — post-AHM call selection matrix covering 5 corridors (Relay<->AH teleport DOT, Relay->para reserve DOT, AH->para transfer USDT, AH->BridgeHub teleport DOT).
  • Decoder for XCM v3/v4/v5 covering 22+ instructions per version.
  • Vector resolver with networkProfiles + networkBehavior (live / chopsticks-only / skip).

@xcm-lens/chain

  • dryRun + estimateFees orchestrators (single dry_run_call source of truth; sharable between APIs).
  • ChainAdapter contract + ChainAdapterPool (TOCTOU-safe in-flight dedup).
  • ChainRegistry — 18 chains (Polkadot + Westend + Paseo system parachains) with trusted teleport sources scaffolded for M5 commit pinning (config/teleport-pins.json).
  • LocationResolver, reanchorLocation, assetIdEq (null/undefined normalized), OriginSynthesizer (Alice on testnets; throws on Polkadot mainnet without explicit origin).
  • StubChainAdapter via @xcm-lens/chain/testing subpath (kept out of production bundles).

xcm-lens-cli

  • decode, build, dry-run (stub default), estimate-fees (stub default), corridors (STATUS.md reader).
  • --live flag opts into the live PAPI adapter (lands in v0.0.3, post-grant work — currently throws with a clear error).

Why this matters for Polkadot

XCM is the ecosystem’s #1 developer friction. Reference points:

  • polkadot-sdk#3050 — XCM v3->v4->v5 migration churn.
  • polkadot-sdk#6637 — Asset Hub Migration’s new transfer_assets call shape breaks every existing integration that doesn’t dynamically dispatch.
  • polkadot-sdk#4736 — builders explicitly asking for runtime-API-driven dry-run + fee-estimation tooling.
  • polkadot-sdk#6774 — no end-to-end XCM cookbook for modern typed PAPI.

Existing tooling falls into three buckets, none of which address XCM message construction + execution + fee discovery in one workflow:

Existing tool What it does XCM execution?
shawntabrizi/polkadot-mcp Read-only RPC over MCP No
r0gue-io/pop-mcp Project scaffolding No
docs.polkadot.com MCP Docs RAG No
Polkadot.js Apps UI for already-formed calls Manual, error-prone

xcm-lens is the missing execution-side tool.

What I’m NOT asking funding for

To be explicit about scope of the Big Tipper ask:

  • This Big Tipper covers ONLY v0.0.2 — the M1 cut already shipped. ~4 days of focused work.
  • v0.0.3 (live PAPI adapter, Chopsticks integration, nightly Westend) is future work I’ll do without grant funding to build a longer track record, before any second proposal.
  • M2 (MCP server for AI agents, error knowledge base) and M3 (90-day patch SLA) would be a separate Small Spender proposal in 4-6 weeks, only after v0.0.3 is shipped and the community has had time to evaluate v0.0.2 usage.

This is NOT a salary request. It’s a one-time tip for finished work.

Budget breakdown (800 DOT ≈ $5,200)

Item Hours Notes
Day 1: monorepo + tooling + decoder 8 SCALE codec helpers, v3/v4/v5 decoder (22+ instructions)
Day 2: IntentSchema v1 + buildFromIntent 10 Post-AHM call selection matrix, 5 corridor vectors, Wednesday review fixes
Day 3@xcm-lens @xcm-lens/chain split + dryRun + estimateFees orchestrators 12 ChainRegistry, LocationResolver, reanchor, fee pipeline, Thursday review fixes
Day 4: M5 scaffolding + CLI + STATUS.md + CONTRIBUTING.md + release 6 Two adversarial review passes, polish, v0.0.2 release
Total 36 hours At $145/hr ≈ $5,220

At 800 DOT × $6.50 = $5,200, this is a fair retroactive rate for senior Polkadot infra work delivered as MIT open source.

Track record

  • PR #12 in polkadot-developers/bounties — 3-chapter PAPI XCM Cookbook (12,500 words + 300 lines of runnable TypeScript on Paseo), submitted 2026-05-29, currently up for tip review.
  • Code is vendored under xcm-lens/resources/cookbook/ so the deliverable is independent of upstream merge timing.
  • GitHub: @1DanWave2
  • Polkadot SS58: 15ou8P2L6GkKj8fio4PeNyZUUaeEJfYqtMifsM3MR8pqq8Lv (where the Big Tipper would settle)

Quickstart for reviewers

git clone https://github.com/1DanWave2/xcm-lens
cd xcm-lens
pnpm install
pnpm -r build
pnpm test                 # 136 tests pass
pnpm vectors:check        # 5/5 build vectors green
node packages/xcm-lens-cli/bin/xcm-lens.mjs build \
  docs/examples/01-relay-to-ah-teleport-dot.json

The CLI defaults to stub mode in v0.0.2 (no network calls, no surprise gas costs in CI). See STATUS.md for the corridor matrix and CONTRIBUTING.md for the dev loop.

What I’d like feedback on (before going on-chain)

  1. Amount calibration — is 800 DOT (~$5.2K) appropriate for the scope? Reference #1340 paid $16K for a comparable scope; #1657 paid $7.5K for a smaller retroactive scope. I’m choosing on the low end of the range to respect the 2026 Treasury tightening signal.
  2. Track choice — Big Tipper (≤1K DOT, 7-day vote) vs Small Spender (≤10K DOT, 28-day vote, larger window for community discussion). I’m picking Big Tipper for v0.0.2 specifically because the ceiling fits the M1-cut scope and the faster cycle matches “retroactive for already-shipped work.”
  3. Future M2/M3 scope — is the community OK with a separate Small Spender proposal in 4-6 weeks for the MCP server + error knowledge base + 90-day SLA, or should that be deferred entirely?
  4. Anything missing in the v0.0.2 cut that would unlock more confident funding (e.g. tagged npm release, docs site, more vectors)?

Happy to iterate on the framing here in the forum before going on-chain. Open to feedback and to changing the ask amount based on comments.

Thanks for reading :folded_hands:

-– @1DanWave2

I’m curious — why build a separate toolkit instead of extending ParaSpell? What do you see as the key difference between XCM Lens and ParaSpell?

Great question @dandan — ParaSpell is the obvious comparison and I want to be honest about where these overlap and where xcm-lens is solving a different problem.

Where ParaSpell is the right tool today: if you’re a DeFi UI integrator who needs to build a typed cross-chain transfer extrinsic — “user has DOT on AH, send to Hydration” — ParaSpell’s Builder() API is exactly that, used in production, with mature chain coverage. I’m not trying to replace it. If a DeFi team came to me asking “should I use xcm-lens or ParaSpell for my swap UI”, I’d point them at ParaSpell.

Where xcm-lens lives is a different layer of the stack — three differences in audience and surface:

  1. CLI + agent-facing, not SDK-facing. ParaSpell’s primary surface is a TypeScript library imported into a dApp. xcm-lens’s primary surface is a CLI you run against an intent file, and (in M2) an MCP server exposing the same toolset to AI agents. Different audience: a dApp developer who already knows what extrinsic they want, vs a person debugging a failed XCM at 3am or an AI agent trying to figure out which extrinsic to construct in the first place.

  2. Decode + explain, not just build. xcm-lens decodes existing XCM blobs (v3/v4/v5, 22 instructions each) into an annotated tree, and the M2 deliverable is an error knowledge base scoring 60% top-1 / 80% top-3 on 50 real failed extrinsics. The build → dry-run → estimate-fees → explain loop is the unit of work, not just “produce a signed extrinsic”. This is the “I have a failed XCM in a block, why did it fail” workflow that today people debug by reading polkadot-sdk source.

  3. Frozen IntentSchema v1 + adversarial-review process as a deliverable. The schema has explicit semver-aware versioning, schema-level invariants (Parachain only at interior[0], fee asset must equal action asset, u64 weights), and the v0.0.2 release came with two public adversarial code review passes that closed 11 critical + 11 major findings. That’s not better engineering — it’s a different commitment shape, suitable for grant-funded retroactive tipping where reviewers want a stable, citable surface to evaluate.

On collaboration: the trusted-teleport pinning work in packages/xcm-lens-chain/src/registry.ts (M5 follow-up) is exactly the kind of thing that would benefit from a shared registry across ParaSpell + xcm-lens + the runtime fellowship — I’d love to chat with the ParaSpell team about whether the citation format I’m using makes sense as a community convention, or whether their existing chain config approach is the better seed.

Bottom line — same lower 30% of the stack (typed cross-chain extrinsic construction), but xcm-lens is targeting a different upper 70% (debugging, decode, agent integration, public adversarial review trail) than ParaSpell’s DeFi-UI focus. Happy to be wrong about any of these dimensions if I’ve misread ParaSpell’s current scope — please correct me.

-– @1DanWave2

LOL, this should be signed:

-- Claude Opus 4.8

Fair callout :sweat_smile: Yes Claude helped me draft both the OP and the previous reply. English structured argumentation is hard for me to write from scratch, and Claude is good at it. Worth surfacing this honestly rather than pretending otherwise.

The technical work is mine to defend independently though. Anyone can verify the concrete claims without trusting either me or the prose:

  • 136 tests: pnpm test from a clone
  • 22 v3 instructions decoded: packages/xcm-lens-core/src/decode/internal/instructions-v3.ts switch on variant index covering 0 (WithdrawAsset) through 36 (UnpaidExecution), in polkadot-sdk’s InstructionV3 order
  • Schema invariants: packages/xcm-lens-core/src/intent-schema.ts superRefine Parachain position, fee-asset equality vs action asset, GeneralKey length consistency
  • Post-AHM call selection: packages/xcm-lens-core/src/build/internal/corridor.ts explicit limited_teleport_assets vs transfer_assets vs limited_reserve_transfer_assets per (source, dest, action) tuple, with reject paths for untrusted teleport pairs
  • The “2 review passes / 11+11 findings closed” is git-traceable in the commit log review → fix → re-test cycle is visible per day
  • MCP server, error knowledge base, 90-day SLA those are scoped, NOT built. Listed as M2/M3 deliverables, separate from this Big Tipper which covers only v0.0.2 already-shipped code

The 800 DOT ask is for the codework, not the prose. If the LLM-assistance on writing is itself disqualifying, I’ll drop the proposal and rewrite anything outstanding in my own English happy to.

The technical work is mine to defend independently though.

Claude is literally in the author list and signed your single commit. You’re asking for 4 months of your Claude max subscription. This is a moot point as OpenGov is closed unless you get explicit buy-in from W3F.

Fair diligence, Taylor. Three points.

Honest division of labor. Claude did the TypeScript boilerplate, the long-form prose (OP + prior reply you read it correctly), and the actual code edits. I did the architectural calls: the @xcm-lens/core (PAPI-free) vs @xcm-lens/chain (PAPI-touching) split motivated by not wanting polkadot-api’s 200KB+ transitive surface on a schema package; the choice to run adversarial multi-agent review after each day’s work; the call to apply each finding. The reviews themselves were also AI. I’m not pretending I solo-wrote 12k lines in 4 days I orchestrated AI-heavy iteration with AI-heavy review and made integration calls.

Two concrete examples of what review caught and I applied: Wednesday’s pass found BurnAsset was redundant in the Teleport template (InitiateTeleport burns on source-side already; a separate BurnAsset drains the holding register before InitiateTeleport sees it). Thursday’s pass found effectsFromDryRunRoot in the fee pipeline was confusing originLocation (dest’s POV of sender) with destLocation (source’s POV of dest), which would silently corrupt any reused dryRun->estimateFees call. Both git-traceable in the commit log if worth verifying.

On the rate. You’re right that 800 DOT is priced as fully-human senior-eng work. Discounting 50% for AI amplification puts it at 400 DOT ($2,600). I’ll adjust the on-chain ask to 400 DOT and edit the OP to surface the AI-orchestration disclosure upfront, not buried in commit metadata. If even 400 is too high for AI-orchestrated retroactive, I’ll withdraw community calls that line.

On “OpenGov closed without W3F”. Big Tipper is permissionless structurally (refs #1340 and #1508 passed 100% Aye without W3F as principal voter), but you’re right that supportive signal matters in practice. If signal stays negative for 5-7 days, I don’t go on-chain. Fair test.

Happy to take any specific technical question on the codebase decoder, builder, dryRun orchestrator, reanchor algorithm, whatever. If something doesn’t read as work I understand, that’s a legitimate signal.

In addition to Taylor’s AI and OpenGov comments, you might want to verify the exchange rates.

right, my rate was old data. at ~$0.93 today, 400 DOT is about $370 not $2.6k. apologies for the noise.

context on the misstep: i dropped 800 → 400 yesterday for the AI-orchestration concern, not because i repriced against current dot/usd. that was sloppy of me.

two honest options:
- keep the ask at 400 DOT and treat the $370 as the retroactive (small but fair for v0.0.2 alone)
- or withdraw the on-chain submission entirely and revisit when m2 lands

leaning toward the first. wanted to flag the rate miss openly instead of quietly editing.

thanks @florentina57 for the catch.

I’m seeing a lot of anti‑AI comments here (maybe because this is a dev‑heavy forum, not a visionary one), as if AI‑produced content can’t be good. Yes, a lot of it is useless, but saying everything AI touches is garbbage is silly and needs to change. To tell you the truht, if someone launches a solution that uses AI, I’m more inlcined to try it than not. Picasso used a brush… should he have painted with his fingers, otherwise he was “aided” by the brush… so do we credit the brush, too?

is not the brush who made the painting but the creative mind behind it, same applies to AI.

appreciated. this is roughly the frame i was trying to land on with the disclosure AI helped me ship faster and find more in adversarial review than i would solo, but the architectural calls and the decision to ship publicly with two open review passes are mine. the brush analogy fits.

best test is the code rather than the meta-argument. happy to walk through any part of the @xcm-lens/core or @xcm-lens/chain split with anyone who wants to dig in.

This is pure AI-slop. You’re not proofing anything its generating. That’s why you quoted $2,400 for 400 DOT, lol. The AI didn’t check the current prices before writing it.

Honestly, this won’t get anywhere unless someone from W3F said they’d vote for you.

You should have had AI proof-read your post for spelling and grammar. I use AI deeply, but I don’t put my name on slop that I didn’t review and prove was correct and accurate.

fair, the rate quote was off. at $0.93/DOT today, 400 DOT is around $370 not $2.4k. used a stale figure when i drafted, didn't double-check. that's on me.

given the rate miss and the open ai-orchestration concerns, i'm going to hold off on the on-chain submission. probably better to revisit after m2 lands and the work speaks for itself in a clearer way.

thanks for the diligence, everyone.

quick update and a reset on this one.

two things i got wrong earlier in this thread and want to own before going further:

  1. the dot/usd rate. i quoted 800 dot as ~$5.2k off stale price data. at ~$0.93/dot that was never right. thanks again @florentina57 for the catch.

  2. the ask size and track. big tipper was too much for this. v0.0.2 is about 4 days of solo work, one m1 cut, already shipped. that fits a small tipper, not a big one.

so i’m revising down to a small tipper, 250 dot max (~$230 at today’s price, i’ll recheck on the day i go on-chain). retroactive, one-time, for v0.0.2 only. no salary, no future-work bundled in.

on the AI question @0xTaylor raised: yeah, i used AI tooling while building this, like a lot of devs do now. not going to pretend otherwise. what i’d ask is that it gets judged on the artifact, not the process. it’s public, MIT, 136 tests pass, 5/5 build vectors green, you can clone and run it in two minutes. the decoder, the intent builder, the corridor matrix, the dry-run and fee orchestrators are all real and reviewable. if any of it doesn’t hold up, point at the line and i’ll fix it.

what v0.0.2 actually does: takes a high-level intent (“teleport dot from asset hub to bridge hub for alice”), builds the right post-AHM extrinsic, dry-runs it, surfaces real XcmPaymentApi fees, and explains each instruction. existing tools do chain state or scaffolding, none do the construct-simulate-explain loop. that’s the gap it fills.

repo: GitHub - 1DanWave2/xcm-lens: Decode, dry-run, and explain XCM messages across Polkadot. CLI + MCP toolkit. · GitHub
quickstart: clone, pnpm install, pnpm -r build, pnpm test (136 pass)

precedent i’m anchoring on: #1340 (pvm debugger, 100% aye, solo-dev oss debugger) and #1657 (retroactive sdk tip, ~$7.5k, smaller scope). a small tipper at 250 dot sits well under both.

if the revised framing is ok here, i’ll put it on-chain as a small tipper next. open to comments on the amount.

quick update and a reset on this one.

two things i got wrong earlier in this thread and want to own before going further:

  1. the dot/usd rate. i quoted 800 dot as ~$5.2k off stale price data. at today’s price that was never right. thanks again @florentina57 for the catch.

  2. the ask size and track. big tipper was too much for this. v0.0.2 is about 4 days of solo work, one m1 cut, already shipped. that fits a small tipper, not a big one.

so i’m revising down to a small tipper, 250 dot max, retroactive, one-time, for v0.0.2 only. no salary, no future-work bundled in.

on the AI question @0xTaylor raised: yeah, i used AI tooling while building this, like a lot of devs do now. not going to pretend otherwise. what i’d ask is that it gets judged on the artifact, not the process. it’s public, MIT, 136 tests pass, 5/5 build vectors green, you can clone and run it in two minutes. the decoder, the intent builder, the corridor matrix, the dry-run and fee orchestrators are all real and reviewable. if any of it doesn’t hold up, point at the line and i’ll fix it.

what v0.0.2 actually does: takes a high-level intent (“teleport dot from asset hub to bridge hub for alice”), builds the right post-AHM extrinsic, dry-runs it, surfaces real XcmPaymentApi fees, and explains each instruction. existing tools do chain state or scaffolding, none do the construct-simulate-explain loop. that’s the gap it fills.

repo: GitHub - 1DanWave2/xcm-lens: Decode, dry-run, and explain XCM messages across Polkadot. CLI + MCP toolkit. · GitHub
quickstart: clone, pnpm install, pnpm -r build, pnpm test (136 pass)

precedent i’m anchoring on: #1340 (pvm debugger, 100% aye, solo-dev oss debugger) and a retroactive sdk tip of larger scope. a small tipper at 250 dot sits well under both.

if the revised framing is ok here, i’ll put it on-chain as a small tipper next. open to comments on the amount.