Skip to content

Build on Chain Daddy ​

Ten things your site, your server or your app can do with Chain Daddy. Each has one line on what it is, the lines you paste, and the page with the rest.

A word on words: creators and their fans see a coin. In the APIs, the SDK and on chain the same thing is a token (an ERC-20 or SPL token), so these guides say token wherever they mean the technical thing.

Building an app for coin pages (a game, a storefront, a tool)? That is further down.

1. Sign in with Chain Daddy ​

People sign in to your site with Chain Daddy, and you learn their wallets, the crowns they hold and whether they hold your coin, with nothing to register.

Try it on http://localhost first, with nothing hosted: use chaindaddy-dev as the client id, skip client.json, and you can see a sign-in in a few minutes. On localhost you see the sign-in and the person's wallets; whether they hold your coin, and their crowns, are answered only on your own https site. One request writes the three pieces, and the quickstart walks through them:

bash
curl -s 'https://api.chaindaddy.io/api/v2/oauth/snippet?origin=http://localhost:3000' |
  jq -r '(.notes[] | "# NOTE: \(.)"), (.steps[] | "\n# \(.title)\n\(.code)")'

When your site goes live, host this at https://YOUR_SITE/client.json:

json
{
  "client_id": "https://YOUR_SITE/client.json",
  "client_name": "Your Site",
  "redirect_uris": ["https://YOUR_SITE/callback.html"],
  "token_endpoint_auth_method": "none"
}

Then add the button:

html
<script src="https://js.chaindaddy.io/v1/cd.js"></script>
<cd-signin-button client-id="https://YOUR_SITE/client.json"
                  redirect-uri="https://YOUR_SITE/callback.html"
                  scope="openid wallets"></cd-signin-button>
<p id="signed-in"></p>
<p id="signin-error" role="alert"></p>
<script>
  // Show who your server says is signed in.
  fetch('/me').then((r) => (r.ok ? r.json() : null)).then((me) => {
    if (me) document.querySelector('#signed-in').textContent = 'Signed in as ' + me.wallet;
  });
  document.querySelector('cd-signin-button').addEventListener('cd-signin', async (e) => {
    const { id_token } = await ChainDaddy.exchangeCode(e.detail);
    const res = await fetch('/session', { method: 'POST', headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ id_token }) });
    if (!res.ok) {
      const { message } = await res.json().catch(() => ({}));
      document.querySelector('#signin-error').textContent = message || 'Sign-in did not work. Try again.';
      return;
    }
    location.reload();
  });
</script>

The button posts the ID token to your server and shows who is signed in. The other two pieces, the callback page and the server that checks the token, are in the quickstart. Any OpenID Connect library works in place of the button. Full page: Sign in with Chain Daddy.

2. Put your coin's apps on your site ​

Your coin's Chain Daddy apps and its card run on your own website, and anything that touches a wallet is approved in a Chain Daddy window.

html
<script async src="https://js.chaindaddy.io/v1/cd.js"></script>

<cd-app crown="123" chain="base" app="slug"><a href="https://chaindaddy.io/SYM/base">$SYM on Chain Daddy</a></cd-app>
<cd-coin crown="123" chain="base"><a href="https://chaindaddy.io/SYM/base">$SYM on Chain Daddy</a></cd-coin>

crown is the coin's number on Chain Daddy, chain its network and app the app's id. Keep the link inside each element: it shows until the app is ready, and stays if the app cannot load.

Your coin manager fills these in for you under Apps on your site. Building the site for someone else? The three values come from reads that need no key: Without the coin manager. The card and read-only apps also show on a page served from http://localhost. Apps that use a wallet run only on your verified sites. Full page: Apps on your own site. A badge and cards with no script: Embeds. To let an app you built run on other sites: Apps on other sites.

3. Take payments on your site ​

Your server opens a checkout session with a store key, the buyer pays on chaindaddy.io by link or in a popup, and comes back to your verified site.

bash
curl -X POST https://api.chaindaddy.io/api/v2/iap/checkout/sessions \
  -H "Authorization: Bearer $CHAINDADDY_IAP_KEY" \
  -H "Idempotency-Key: cart-8842-attempt-1" \
  -H "Content-Type: application/json" \
  -d '{
    "lineItems": [{ "sku": "credits.100", "quantity": 1 }],
    "successUrl": "https://example.com/thanks",
    "cancelUrl": "https://example.com/cart",
    "clientReferenceId": "cart-8842"
  }'

Send the buyer to the url in the answer. With the script, the same link opens in a popup:

html
<script async src="https://js.chaindaddy.io/v1/cd.js"></script>

<a href="https://chaindaddy.io/_pay/cs_0f3a9c1e…" data-cd-checkout data-cd-success="/thanks">Pay with Chain Daddy</a>

To take live payments you need a store for your coin (any paid plan, and the Seller Terms signed), a verified site and a store key. To try it first on http://localhost you need nothing and nobody: no account, no key, no verified site, no money and no wallet. Run the example is one server file and two pages that take a first test payment on your own machine, on a public demo key the guide prints.

Full page: Take payments on your site, with a whole webhook handler. The store behind it: Store and Rewards.

4. Public API ​

Four reads need no key and no sign-in, answer any origin, and are cached for about a minute.

bash
curl https://api.chaindaddy.io/api/v2/public/coins/base/FLUXGP

Full page: Public reads. Which operations are kept stable, and for how long: Versioning and Deprecation, with the contract itself at /openapi-public.yaml. Everything else, with a key: Authentication.

5. Webhooks ​

Chain Daddy sends your server a signed POST when something happens: a sale in your store, a sale through your app, a registration, a deal.

bash
curl -X POST https://api.chaindaddy.io/api/v2/webhooks \
  -H "X-API-Key: $CHAINDADDY_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks/chaindaddy",
    "events": ["token.minted", "heartbeat.warning"]
  }'

Full page: Webhooks, with the signature check and what happens when a delivery fails. A store has a webhook of its own, with the store's own plan (any paid plan) and no Developer plan (chaindaddy iap webhook set 3f0c… --url https://app.example.com/hooks/chaindaddy): Your store's webhook. An app's sales: Paid Apps: Webhooks.

6. Verify a payment ​

Check on chain that a store order was paid, with your own RPC endpoint and without trusting our API.

sh
npm install @chaindaddy/js
javascript
import { verifyPayment, VerifyError } from '@chaindaddy/js/verify';

const result = await verifyPayment(verification, {
  rpcUrl: process.env.RPC_URL,      // your own JSON-RPC endpoint for that chain, not ours
  expect: { orderId, ...SALE },
});
console.log(result.paid ? `paid by ${result.payer}` : 'not paid yet');

verification is the block on the order, and SALE is what you sold, from your own records. Full page, with the whole script and the same check by hand on EVM and Solana: Verify a payment.

7. JavaScript SDK ​

One script, or one npm package, carries the sign-in button, the app and card elements, the checkout popup and the payment check.

html
<script src="https://js.chaindaddy.io/v1/cd.js"></script>
sh
npm install @chaindaddy/js

Full page: JavaScript SDK, with pinned versions and Subresource Integrity.

8. Build with AI (MCP) ​

Your coding agent gets Chain Daddy's tools and docs from one address, with no key.

https://api.chaindaddy.io/mcp
bash
claude mcp add --transport http chaindaddy https://api.chaindaddy.io/mcp

Full page, with the plugin and every other AI app: Build with AI. Every tool: MCP Tools. The docs as one file for an agent: /llms.txt.

9. Test mode ​

Your store has a test store beside it: the same API, a cd_iap_test_… key, and no money moves.

bash
npm install -g @chaindaddy/cli@beta       # once; needs Node.js 20 or later
chaindaddy login                          # once: sign in through your browser

chaindaddy iap store test 3f0c… --json
#   → {"ok":true,"store":{"id":"7a21…","mode":"test","name":"MYTOKEN (test)","feeBps":0,…}}

With buttons it is the Test switch beside your store's name in the Developer portal, and a test key from its Keys tab (Get a test key). With no coin and no key yet, the guide prints a demo key that takes a first test payment on your own machine.

Full page: Test, with a test checkout on your site, which works on http://localhost, sign-in and apps on your site. Is it us or you? Status checks the API, the JavaScript library and the embed host from your browser.

10. Partners ​

A company that builds on Chain Daddy gets the same rates as on chaindaddy.io, credit for what its app brings, a share of our fee on it, and its own quota.

bash
curl -u "$CD_CLIENT_ID:$CD_CLIENT_SECRET" https://api.chaindaddy.io/api/v2/oauth/via \
  -d kind=launch -d symbol=FLUXGP
#   → {"via":"v1.…"}

Full page: Build your product on Chain Daddy.

Build an app for coin pages ​

Build an app once, and any coin page can install it. Coin owners add apps to their page on every plan.

New here? Publish your first app is the whole path, from a game or a widget on your computer to a coin page. What you can publish, what it costs and the rules are on Publish on Chain Daddy.

What an app is ​

KindWhat it isStart from
Engine appA game you already built for the browser, run as it is: any web build, or a Godot or Unity web exportEngine apps
WidgetA React component the page draws: a storefront, a gallery, a chart, a new gameTemplates, Widget development
RunnerA server of yours that receives a page's events. Most apps need noneRunners and events

An app runs in a sealed frame on the page and asks the page for anything sensitive (a sale, a sign-in, a signature) through actions. An app can sell the page's items, or its own on every page that installs it: Store and Rewards, Paid Apps.

Developer Beta Program ​

Publishing apps is open to every developer, in a beta. To publish you need:

  • any paid plan, monthly or yearly, from $5 a month, or a plan from a promo code while it lasts (a free trial does not count), and
  • the Developer Beta Program Agreement, signed by the wallet of the account that holds the plan. You sign it in the Developer Portal.

The steps are in Publish your first app, and chaindaddy app whoami says which you still lack.

  • Joining does not change the price, fees or limits of your plan.
  • Identity verification, on the portal's Account page, is optional.
  • If your plan ends, you keep the portal but cannot submit or send a build to review until a paid plan is active again, and your apps leave the Apps directory and stop running on coin pages until then. Pages that installed them keep them; they come back by themselves when your plan is active again.
  • A Safe can join: its owners sign from the command line with chaindaddy developer accept-agreement.
  • Selling your own items through your apps also needs the Paid Apps Addendum.

Questions, or a bug that blocks you from shipping: DM us on Telegram or Discord (chaindaddy_og).

Guides ​

ToRead
BuildEngine apps · Templates · Widget development · Build a game · Build with AI · Build your product on Chain Daddy
Sell and rewardStore and Rewards · Token prizes · Paid Apps
Test and shipTest · Submitting an app · What your app must do · Apps on other sites
Look something upActions · App manifest · Code pages · Runners and events · Verifying tokens · CLI