What you can build on Radiant¶
pyrxd is a Python SDK for the Radiant (RXD) blockchain:
transaction building, HD wallets, the Glyph token protocol (NFT / FT / dMint),
same-chain swaps, and trustless cross-chain atomic swaps. This page is a
tour of what is real and proven today, with on-chain transactions you can open
in a block explorer and runnable examples you can read.
A note on honesty up front: every link below points either to a real on-chain transaction or to code in this repository. pyrxd is open-source software, provided as-is, without warranty — see the LICENSE. Where a capability is proven by a small proof run rather than at scale, this page says so explicitly, so verify it yourself before moving real value.
Trustless cross-chain atomic swaps¶
The headline. pyrxd.gravity implements HTLC (hash-time-locked contract)
atomic swaps between Radiant and other chains. The mechanism, in one breath:
both sides lock their asset to the same hash; revealing the secret preimage to
claim one side mathematically reveals it to claim the other; if nobody claims,
a timelock lets each party refund. There is no middleman and no custodian —
the swap either completes for both parties or unwinds for both. That is what
“atomic” means.
Proven swap directions¶
Each row below is a real swap that was carried out end-to-end on real chains. Open any transaction in its explorer.
Direction |
Networks |
Proof (claim transactions) |
|---|---|---|
BTC ↔ RXD |
Bitcoin mainnet ↔ Radiant mainnet (real value, both sides) |
BTC claim: |
ETH ↔ RXD |
Ethereum Sepolia testnet ↔ Radiant mainnet |
ETH claim (Sepolia): |
Glyph NFT ↔ ETH |
NFT on Radiant mainnet ↔ Ethereum Sepolia testnet |
NFT minted: |
Glyph FT ↔ ETH |
FT on Radiant mainnet ↔ Ethereum Sepolia testnet |
FT minted: |
Network labels are exact. BTC and RXD legs were on mainnet with real value. Every ETH leg was on the Ethereum Sepolia testnet — not Ethereum mainnet.
What these runs prove (and don’t). These were small “dust” / proof runs that demonstrate the mechanism on real chains: a single-operator run shows the plumbing works end-to-end. It does not exercise an adversarial untrusted counterparty at scale. The cross-chain swap stack is unaudited — verify it yourself before moving real value with someone you don’t trust.
Build it¶
Tutorial: trustless cross-chain swap (RXD ↔ ETH) — the guided flagship: watch a full swap settle on local Anvil + a Radiant regtest node in seconds.
How-to: build a cross-chain atomic swap — the
SwapCoordinator+ legs surface (from pyrxd import SwapCoordinator, …), the role/timelock safety invariant, and how to add another counter-chain (BTC, ETH, and the EVM L2s — Base, Optimism, Arbitrum, Linea — reuse the proven legs verbatim).examples/htlc_swap_demo.py— build a real HTLC covenant + the claim/refund spends with no network (the current path; thegravity_*SPV-oracle demos are deprecated and superseded by this HTLC swap).Concept walkthrough:
docs/concepts/gravity.md.
Native tokens¶
Radiant carries tokens natively via the Glyph protocol. pyrxd builds all
of them — and the NFT/FT mints above are themselves on-chain proof that the mint
path works on mainnet.
NFTs —
examples/glyph_mint_demo.py: a two-phase commit/reveal NFT mint on Radiant mainnet. Tutorial:docs/tutorials/mint-a-glyph-nft.md.Fungible tokens —
examples/ft_deploy_premine.py: issue your own FT with a full premine; the reveal output’s outpoint becomes the permanent token ref. Tutorial:docs/tutorials/mint-a-glyph-ft.md.dMint (permissionless mining-based issuance) — deploy a token anyone can mine (
pyrxd glyph deploy-dmint) and mine/claim from one (pyrxd glyph claim-dmint): a V1 contract emits N parallel UTXOs, each mineable independently so claims race in parallel. How-to:docs/how-to/issue-a-dmint-token.md; example:examples/dmint_v1_deploy_demo.py; concept:docs/concepts/dmint-v1-deploy.md.
Beyond plain tokens, the covenant layer is where Radiant is genuinely different:
HTLC covenants, a consensus-enforced soulbound NFT, the REF-authenticity gate,
and credential-bound swap gating — mapped as composable primitives in
docs/concepts/covenant-building-blocks.md.
New to all this? The fastest way to mint a real token with zero risk is the
local-regtest quickstart: docs/tutorials/quickstart.md
(stand up a private chain in Docker, mint, tear it down).
Same-chain swaps¶
For trading two assets that both live on Radiant — RXD ↔ token, or token ↔
token — pyrxd.swap gives you a guard-railed partial-transaction API. It
uses signature-level atomicity (SIGHASH_SINGLE | ANYONECANPAY): the maker
signs one input committing to one output of what they want back, the taker adds
their own inputs/outputs to complete the trade, and the whole thing settles in a
single transaction — no escrow, no covenant, no second transaction. Because
both legs are in one transaction, it confirms wholly or not at all.
The core create_offer / accept_offer flow is pure Python and needs no
node — you can build and verify an offer entirely offline and only touch the
network to broadcast.
examples/partial_swap_demo.py— the full offer → transport → accept → verify flow, self-contained and runnable with no node and no network.Concept:
docs/concepts/partial-tx-swaps.md.
This same-chain swap API is implemented and unit-tested (including adversarial cases). As with every value-moving primitive here, it is open-source and provided as-is — verify it against your own use before moving real value.
Start building¶
5-minute quickstart —
docs/tutorials/quickstart.md:pip install pyrxd, bring up a local regtest chain in Docker, and mint your first real on-chain Glyph token — no faucet, no mainnet RXD, nothing at risk.Browse the runnable examples — the
examples/index gives a guided path through end-to-end scripts for every flow above, each labeled with its network and whether it defaults to a safe dry-run.Read the concepts —
docs/concepts/index.mdcovers Glyph structures, Gravity, dMint, and partial-tx swaps in depth.