<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kynto</title>
    <description>The latest articles on DEV Community by Kynto (@kynto).</description>
    <link>https://dev.to/kynto</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3914838%2Fabdbdf10-76a2-4bf3-827f-0d159eef72d7.png</url>
      <title>DEV Community: Kynto</title>
      <link>https://dev.to/kynto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kynto"/>
    <language>en</language>
    <item>
      <title>I Built an API That Earns XRP Automatically — Here's Exactly How It Works</title>
      <dc:creator>Kynto</dc:creator>
      <pubDate>Wed, 06 May 2026 02:12:22 +0000</pubDate>
      <link>https://dev.to/kynto/i-built-an-api-that-earns-xrp-automatically-heres-exactly-how-it-works-36n7</link>
      <guid>https://dev.to/kynto/i-built-an-api-that-earns-xrp-automatically-heres-exactly-how-it-works-36n7</guid>
      <description>&lt;p&gt;I spent the last few months building something I haven't seen done before on the XRP Ledger: a live, production API that charges per request in XRP — with zero subscriptions, zero API keys, and zero manual invoicing. The money just arrives.&lt;br&gt;
It's called xrplriskscore.ai. It scores XRPL wallet risk in real time and returns an ALLOW, CHALLENGE, or BLOCK verdict before you sign a transaction. AI agents, DeFi protocols, and compliance teams use it to check counterparties before moving money.&lt;br&gt;
This is the technical story of how I built it.&lt;/p&gt;

&lt;p&gt;The Problem I Was Solving&lt;br&gt;
When an AI agent on the XRP Ledger wants to pay someone, send tokens, or interact with a smart contract — it's flying blind. There's no credit score for wallets. No fraud signal. No way to know if the counterparty is a brand-new burner account or a well-established participant.&lt;br&gt;
The agent or developer just has to trust. That's a gap.&lt;br&gt;
I built the tool I wished existed.&lt;/p&gt;

&lt;p&gt;The Payment Protocol: x402&lt;br&gt;
The magic that makes per-request payments work is the x402 protocol — an extension of HTTP that uses the 402 Payment Required status code (which has existed since 1995 but was never used).&lt;br&gt;
Here's the flow:&lt;/p&gt;

&lt;p&gt;Client calls GET /score/rWalletAddress&lt;br&gt;
Server responds 402 Payment Required with an invoice: amount, destination wallet, and an invoiceId&lt;br&gt;
Client constructs an XRPL Payment transaction with the invoiceId in the Memos field&lt;br&gt;
Client signs and submits the transaction, then retries the original request with a PAYMENT-SIGNATURE header&lt;br&gt;
An x402 facilitator verifies the on-ledger payment and lets the request through&lt;br&gt;
Server responds with the risk score&lt;/p&gt;

&lt;p&gt;No Stripe. No API keys. No monthly billing. The XRP just arrives in my wallet.&lt;br&gt;
javascript// What the 402 response looks like&lt;br&gt;
{&lt;br&gt;
  "x402Version": 1,&lt;br&gt;
  "accepts": [{&lt;br&gt;
    "scheme": "exact",&lt;br&gt;
    "network": "xrpl:0",&lt;br&gt;
    "maxAmountRequired": "1000000", // 1 XRP in drops&lt;br&gt;
    "resource": "&lt;a href="https://xrplriskscore.ai/score/rWalletAddress" rel="noopener noreferrer"&gt;https://xrplriskscore.ai/score/rWalletAddress&lt;/a&gt;",&lt;br&gt;
    "description": "Full 31-signal XRPL wallet risk score",&lt;br&gt;
    "memoRequired": {&lt;br&gt;
      "invoiceId": "uuid-generated-per-request"&lt;br&gt;
    },&lt;br&gt;
    "paymentAddress": "rU7kCg3PrDGXtKocUpEvpy6xiTgvsKLHPG"&lt;br&gt;
  }]&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The Scoring Engine: 31 Signals&lt;br&gt;
The risk score runs 31 signals across several categories and returns a 0–100 score plus a verdict.&lt;br&gt;
Account fundamentals: Age in days, reserve ratio, whether the account has established trustlines, and account history consistency.&lt;br&gt;
Behavioral signals: Transaction velocity, counterparty diversity, DEX activity patterns, and machine-readable behavioral tags like DORMANT, HIGH_VELOCITY, and LOW_DIVERSITY.&lt;br&gt;
Asset exposure: Stablecoin holdings, tokenized asset trustlines, NFT activity, and escrow participation.&lt;br&gt;
Network analysis: How the wallet's counterparty graph looks — cluster density, hop distance from known risk clusters, and aggregate counterparty exposure.&lt;br&gt;
Sub-scores: Every full score response breaks down into activity_score, asset_score, network_score, and behavior_score so callers can weight what matters to their use case.&lt;br&gt;
The verdict logic:&lt;br&gt;
Score 0–30   → ALLOW     (low risk, proceed)&lt;br&gt;
Score 31–60  → CHALLENGE (medium risk, verify before proceeding)&lt;br&gt;
Score 61–100 → BLOCK     (high risk, do not transact)&lt;br&gt;
Important framing: the score informs the decision, it never makes it. The agent or person calling the API still decides what to do. The score just means they're not flying blind.&lt;/p&gt;

&lt;p&gt;The Architecture&lt;br&gt;
The service is a Node.js Express app deployed on Railway with auto-deploy from GitHub.&lt;br&gt;
server.js                 ← Express app, all 8 paid endpoints&lt;br&gt;
weekly-report-agent.js    ← Worker process (scheduled tasks)&lt;br&gt;
.well-known/&lt;br&gt;
  x402.json               ← Payment manifest (discoverable by x402 clients)&lt;br&gt;
  openapi.json            ← OpenAPI spec&lt;br&gt;
Eight paid endpoints, all settling via x402 on XRPL mainnet:&lt;br&gt;
EndpointPriceWhat it doesGET /score/:wallet1 XRPFull 31-signal scoreGET /prescore/:wallet0.1 XRP3-signal quick verdictGET /rwa-check/:wallet0.5 XRPRLUSD / tokenized asset complianceGET /credential-check/:wallet0.5 XRPXLS-80/81 Permissioned DomainGET /escrow-check/:wallet0.5 XRPXLS-85 escrow counterparty riskPOST /score-batch8/20/40 XRP10/25/50 wallets in bulkPOST /compliance-bundle3 XRPScore + RWA + credential in parallelPOST /provision-wallet4 XRPGenerate, fund, and score a new wallet&lt;br&gt;
There's also a free demo tier: 3 calls per IP per 24 hours, returns verdict only — no reasoning, signals, or breakdown. This drives conversion to paid.&lt;/p&gt;

&lt;p&gt;The MCP Integration&lt;br&gt;
Beyond the REST API, I published an MCP (Model Context Protocol) server so Claude and other AI assistants can call the service natively as a tool — no HTTP knowledge required.&lt;br&gt;
bashnpx -p @xrplriskscore/mcp xrplriskscore-mcp-setup&lt;br&gt;
This registers 9 tools in Claude Desktop:&lt;/p&gt;

&lt;p&gt;check_xrpl_wallet_risk&lt;br&gt;
quick_xrpl_prescore&lt;br&gt;
explain_xrpl_risk_score&lt;br&gt;
check_xrpl_rwa_compliance&lt;br&gt;
check_xrpl_credential_eligibility&lt;br&gt;
check_xrpl_escrow_counterparty&lt;br&gt;
check_xrpl_compliance_bundle&lt;br&gt;
provision_xrpl_wallet&lt;br&gt;
list_xrpl_risk_endpoints&lt;/p&gt;

&lt;p&gt;When a user asks Claude "is this wallet safe to pay?", Claude calls the tool, the x402 payment happens automatically, and the answer comes back — all inside the conversation.&lt;br&gt;
The MCP package is live on npm at @xrplriskscore/mcp and registered in the Anthropic MCP registry.&lt;/p&gt;

&lt;p&gt;A Bug That Broke Everything (and What I Learned)&lt;br&gt;
Early on, every single wallet was scoring as INSTITUTIONAL — a perfect 0 risk score, no matter what address you scored.&lt;br&gt;
The bug: I was using a field from the XRPL account_info response to measure transaction history. The field I thought existed didn't. What I was actually reading was the account Sequence number — which for modern XRPL wallets sits in the tens of millions due to how the ledger tracks account state.&lt;br&gt;
A "transaction count" of 10,000,000+ meant every wallet looked like it had been active for decades. Every wallet passed every signal.&lt;br&gt;
The fix was straightforward once I found it: pull actual transaction history and use transactions.length. The lesson: always verify which fields actually exist in API responses before using them in scoring logic. Never assume.&lt;/p&gt;

&lt;p&gt;What's Working and What's Not (Honest Assessment)&lt;br&gt;
Working:&lt;/p&gt;

&lt;p&gt;Service is live and processing requests on XRPL mainnet&lt;br&gt;
x402 payments settle on-ledger automatically&lt;br&gt;
MCP server registered and working in Claude Desktop&lt;br&gt;
ChatGPT custom GPT live in the store&lt;br&gt;
Free demo tier driving exploration&lt;/p&gt;

&lt;p&gt;Honest gaps:&lt;/p&gt;

&lt;p&gt;The x402 ecosystem is very early — most developers don't know x402 exists yet, so the discovery surface is still small&lt;br&gt;
Some ecosystem directories have schema compatibility issues with XRPL's network identifier vs. EVM-based implementations — a known gap in the broader x402 space&lt;br&gt;
As a sole operator, distribution is the hardest part — the tech works, getting in front of the right people takes time&lt;/p&gt;

&lt;p&gt;Try It&lt;br&gt;
Free demo — no payment needed:&lt;br&gt;
bashcurl &lt;a href="https://xrplriskscore.ai/score/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" rel="noopener noreferrer"&gt;https://xrplriskscore.ai/score/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh&lt;/a&gt;&lt;br&gt;
MCP install for Claude Desktop:&lt;br&gt;
bashnpx -p @xrplriskscore/mcp xrplriskscore-mcp-setup&lt;br&gt;
API reference: xrplriskscore.ai/.well-known/openapi.json&lt;br&gt;
Methodology: xrplriskscore.ai/methodology&lt;br&gt;
website: xrplriskscore.ai&lt;/p&gt;

&lt;p&gt;If you're building on XRPL and want pre-transaction wallet intelligence, this is what it's for. Happy to answer questions in the comments.&lt;/p&gt;

</description>
      <category>xrpl</category>
      <category>ai</category>
      <category>webmonetization</category>
      <category>blockchain</category>
    </item>
  </channel>
</rss>
