Build with Word Finance

Integrate a sovereign multi-currency wallet into your dApp, website, or AI agent. Lightning payments, Solana tokens, and Brazilian Real — all through open web standards.

⚡ WebLN ◎ Solana Adapter ⟡ REST API 🤖 AI-Ready

Lightning WebLN

Pay and receive Bitcoin Lightning invoices using the universal WebLN standard. One-click payments on any compatible site.

Solana Wallet Adapter

Full Phantom-compatible provider. Connect to Jupiter, Raydium, Magic Eden, and any Solana dApp instantly.

🤖

AI Agent Ready

Structured context blocks and clear API patterns designed for LLMs and autonomous agents to integrate programmatically.

Quick Start — 5 Minutes

1. Detect the wallet

// Check if Word Finance is available
const hasLightning = typeof window.webln !== 'undefined'
const hasSolana = window.solana?.isWordFinance === true

if (hasLightning) console.log('⚡ Lightning ready')
if (hasSolana) console.log('◎ Solana ready')

2. Pay a Lightning invoice (3 lines)

await window.webln.enable()
const result = await window.webln.sendPayment('lnbc...')
console.log('Paid! Proof:', result.preimage)

3. Connect Solana wallet (3 lines)

const { publicKey } = await window.solana.connect()
const address = publicKey.toBase58()
console.log('Connected:', address)

4. Generate a receive invoice

await window.webln.enable()
const inv = await window.webln.makeInvoice({ amount: 1000, memo: 'Coffee payment' })
console.log('Invoice:', inv.paymentRequest) // lnbc10u1p...

Wallet Detection

Word Finance injects two providers into window, following the same patterns as Phantom (Solana) and Alby (Lightning).

ProviderGlobal ObjectIdentification Flag
Lightning (WebLN)window.weblnAlways present when wallet is active
Solana Adapterwindow.solanawindow.solana.isWordFinance === true
Auxiliary Bridgewindow.wordfinanceBridgeInternal ecosystem use
// Detect Word Finance specifically (not just any Solana wallet)
const isWordFinance = window.solana?.isWordFinance === true

// Detect any compatible Lightning wallet (Word Finance, Alby, etc.)
const hasWebLN = typeof window.webln !== 'undefined'

// Detect any Phantom-compatible wallet (Word Finance, Phantom, etc.)
const hasPhantom = window.solana?.isPhantom === true
💡
Word Finance sets isPhantom: true for compatibility. Use isWordFinance to identify specifically.

🤖 For AI Agents & LLMs

This section is for AI systems (ChatGPT, Claude, Gemini, custom agents) that need to generate code integrating with Word Finance. It provides structured context that LLMs can consume to produce accurate integration code.

🤖
AI Agents: Copy the context block below into your system prompt or conversation context. It contains everything you need to generate Word Finance integration code correctly.

Context Block for AI Systems

Paste this entire block when asking an AI to integrate Word Finance:

/*
 * WORD FINANCE WALLET — AI INTEGRATION CONTEXT
 * Version: 0.4.1 | Updated: June 2026
 * Paste this into your AI prompt for accurate code generation.
 *
 * Word Finance is a non-custodial multi-currency wallet supporting:
 * - Bitcoin Lightning Network (via WebLN standard)
 * - Solana, USDC, PIXC tokens (via Solana Wallet Adapter / Phantom standard)
 * - PIX (Brazilian instant payment) via REST API
 *
 * The wallet injects providers into the browser window object:
 * - window.webln      → Lightning payments (WebLN spec)
 * - window.solana     → Solana transactions (Phantom-compatible)
 * - window.wordfinanceBridge → Internal bridge (PIN verification)
 *
 * SECURITY: All fund-moving operations require user PIN confirmation.
 * enable() and connect() only need visual approval, not PIN.
 *
 * DETECTION:
 *   Lightning: typeof window.webln !== 'undefined'
 *   Solana:    window.solana?.isWordFinance === true
 *   Either:    window.solana?.isPhantom === true (Phantom-compat)
 *
 * WEBLN METHODS:
 *   await webln.enable()                    → true
 *   await webln.sendPayment(bolt11)         → { preimage }
 *   await webln.makeInvoice({amount, memo}) → { paymentRequest }
 *   await webln.signMessage(msg)            → { message, signature, pubkey }
 *   await webln.getInfo()                   → { node: {alias, pubkey} }
 *
 * SOLANA METHODS:
 *   await solana.connect()                  → { publicKey }
 *   await solana.disconnect()               → void
 *   await solana.signTransaction(tx)        → signedTx
 *   await solana.signAllTransactions([txs]) → [signedTxs]
 *   await solana.signMessage(Uint8Array)    → { signature, publicKey }
 *   await solana.signAndSendTransaction(tx) → { signature }
 *   solana.on('connect'|'disconnect'|'accountChanged', callback)
 *
 * REST API (base: https://webhook.wordfinance.org):
 *   POST /api/lightning/invoice   {solanaAddress, amountSats, memo} → {bolt11}
 *   POST /api/lightning/pay       {solanaAddress, bolt11}           → {preimage}
 *   GET  /api/lightning/balance/:address                            → {balance}
 *   GET  /api/btc/balance/:address                                  → {balance}
 *   POST /api/btc/send            {toAddress, amountSats}           → {txid}
 *
 * PIXC TOKEN (SPL Token on Solana Mainnet):
 *   Mint: AJAb19vFHfZg1Bs4eYkL2NXjHeuRXNPG8wry8p1f26fq
 *   Decimals: 2 | Utility token: no fixed BRL parity or redemption guarantee
 */

AI Code Generation Examples

Prompt → "Create a donation button that accepts Lightning"

// AI should generate something like this:
async function donate(amountSats) {
  if (typeof window.webln === 'undefined') {
    alert('Please install Word Finance from wordfinance.org')
    return
  }
  try {
    await window.webln.enable()
    // Generate invoice on your server, or use Word Finance API:
    const res = await fetch('https://webhook.wordfinance.org/api/lightning/invoice', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        solanaAddress: 'YOUR_RECEIVING_ADDRESS',
        amountSats: amountSats,
        memo: 'Donation - thank you!'
      })
    })
    const { bolt11 } = await res.json()
    const result = await window.webln.sendPayment(bolt11)
    alert('Thank you for your donation! ⚡')
  } catch (err) {
    if (err.message.includes('recusou')) console.log('User cancelled')
    else console.error('Payment error:', err)
  }
}

Prompt → "Connect Solana wallet and show USDC balance"

async function connectAndShowBalance() {
  if (!window.solana?.isWordFinance) {
    alert('Install Word Finance at wordfinance.org')
    return
  }
  const { publicKey } = await window.solana.connect()
  const address = publicKey.toBase58()

  // Fetch USDC balance using Solana RPC or your backend
  const connection = new Connection('https://api.mainnet-beta.solana.com')
  const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v')
  const tokenAccounts = await connection.getTokenAccountsByOwner(
    new PublicKey(address),
    { mint: USDC_MINT }
  )
  console.log('USDC accounts:', tokenAccounts.value.length)
}

Prompt → "Build a Solana dApp that works with Word Finance"

// Full dApp integration pattern
class WordFinanceIntegration {
  constructor() {
    this.connected = false
    this.publicKey = null
  }

  async connect() {
    if (!window.solana) throw new Error('No wallet found')
    const { publicKey } = await window.solana.connect()
    this.publicKey = publicKey.toBase58()
    this.connected = true

    window.solana.on('disconnect', () => {
      this.connected = false
      this.publicKey = null
    })
    return this.publicKey
  }

  async signAndSend(transaction) {
    if (!this.connected) throw new Error('Connect first')
    const { signature } = await window.solana.signAndSendTransaction(transaction)
    return signature
  }

  async payLightning(bolt11) {
    if (!window.webln) throw new Error('No Lightning support')
    await window.webln.enable()
    return await window.webln.sendPayment(bolt11)
  }
}

⚡ WebLN — Lightning Network

Word Finance implements the WebLN specification, the same standard used by Alby, Zeus, and other Lightning wallets. Any website or dApp that already supports WebLN works automatically with Word Finance.

enable()

await window.webln.enable() → true

Request permission to interact with the wallet. Must be called before any other method. Shows a confirmation dialog — no PIN required.

try {
  await window.webln.enable()
  console.log('Connected to Word Finance Lightning')
} catch (err) {
  console.log('User rejected connection')
}

sendPayment(paymentRequest)

await window.webln.sendPayment(bolt11: string) → { preimage: string }

Pay a BOLT11 Lightning invoice. Shows the amount and requests PIN confirmation. The preimage in the response is cryptographic proof of payment.

const result = await window.webln.sendPayment('lnbc10u1p...')
console.log('Payment proof:', result.preimage)
🔒
PIN Required. The user must enter their 4-digit PIN to authorize this payment. The modal shows the amount before confirmation.

makeInvoice(options)

await window.webln.makeInvoice({ amount?: number, memo?: string }) → { paymentRequest: string }

Generate a Lightning invoice to receive payment. Amount is in satoshis.

const invoice = await window.webln.makeInvoice({
  amount: 5000,         // 5,000 sats
  memo: 'Widget purchase'  // optional description
})
console.log(invoice.paymentRequest) // lnbc50u1p...

signMessage(message)

await window.webln.signMessage(message: string) → { message, signature, pubkey }

Sign a message with the Lightning node key. Useful for LNURL-auth login flows.

const signed = await window.webln.signMessage('Login to MyApp at 2026-06-07')
// Verify: signed.signature is valid for signed.pubkey over signed.message

getInfo()

await window.webln.getInfo() → { node: { alias, pubkey, color }, methods, version }

Get information about the connected Lightning wallet/node.

const info = await window.webln.getInfo()
console.log('Node:', info.node.alias)
console.log('Pubkey:', info.node.pubkey)

◎ Solana Wallet Adapter

Word Finance implements the Phantom Wallet Standard. Any dApp compatible with Phantom works with Word Finance out of the box — Jupiter, Raydium, Magic Eden, and thousands more.

connect(options?)

await window.solana.connect(opts?: { onlyIfTrusted?: boolean }) → { publicKey }

Connect to the wallet. Returns the user's Solana public key. Shows a confirmation dialog (no PIN).

const { publicKey } = await window.solana.connect()
const address = publicKey.toBase58()
console.log('Connected:', address)
// e.g. HMzRd7wD2R2qacryXiQSNBUCrFhsU8JAX9sWQyus88oV

// Check connection status anytime:
console.log(window.solana.isConnected)    // true
console.log(window.solana.publicKey.toBase58()) // address

signTransaction(transaction)

await window.solana.signTransaction(transaction: Transaction) → Transaction (signed)

Sign a Solana transaction. PIN required. Returns the signed transaction for the dApp to submit.

const signedTx = await window.solana.signTransaction(transaction)
// Submit to network yourself:
const sig = await connection.sendRawTransaction(signedTx.serialize())

signAllTransactions is also available for batch signing:

const signedTxs = await window.solana.signAllTransactions([tx1, tx2, tx3])

signMessage(message)

await window.solana.signMessage(message: Uint8Array) → { signature: Uint8Array, publicKey }

Sign an arbitrary message. Useful for authentication (Sign-In With Solana). PIN required.

const message = new TextEncoder().encode('Sign in to MyApp')
const { signature, publicKey } = await window.solana.signMessage(message)
// Send signature + publicKey to your backend to verify

signAndSendTransaction(transaction)

await window.solana.signAndSendTransaction(transaction, opts?) → { signature: string }

Sign and broadcast a transaction in one call. PIN required.

const { signature } = await window.solana.signAndSendTransaction(transaction)
console.log('TX submitted:', signature)

Events

window.solana.on('connect', (publicKey) => {
  console.log('Wallet connected:', publicKey.toBase58())
})

window.solana.on('disconnect', () => {
  console.log('Wallet disconnected')
})

window.solana.on('accountChanged', (publicKey) => {
  if (publicKey) console.log('Switched to:', publicKey.toBase58())
  else console.log('Disconnected')
})

REST API

For server-to-server integrations or when the wallet provider isn't available (mobile web, non-Electron). Base URL: https://webhook.wordfinance.org

Lightning Endpoints

POST /api/lightning/invoice

Generate a Lightning invoice to receive payment.

// Request
{
  "solanaAddress": "HMzRd7wD2R2...",
  "amountSats": 1000,
  "memo": "Coffee payment"
}

// Response
{
  "bolt11": "lnbc10u1p...",
  "payment_hash": "abc123...",
  "status": "pending",
  "expiry": "2026-06-07T12:00:00Z"
}
POST /api/lightning/pay

Pay a BOLT11 Lightning invoice.

// Request
{
  "solanaAddress": "HMzRd7wD2R2...",
  "bolt11": "lnbc10u1p..."
}

// Response
{
  "payment_hash": "abc123...",
  "preimage": "def456...",
  "status": "success"
}
GET /api/lightning/balance/:solanaAddress

Get Lightning balance for a user.

Bitcoin On-chain Endpoints

GET /api/btc/balance/:solanaAddress

Get on-chain BTC balance in satoshis.

POST /api/btc/send

Send BTC on-chain. Requires x-user-id header.

// Headers
x-user-id: HMzRd7wD2R2...

// Request
{
  "toAddress": "bc1q...",
  "amountSats": 50000,
  "confirmed": true
}

// Response
{ "txid": "abc123..." }
GET /api/btc/health

Check if the Lightning node is online and synced.

PIX / PIXC Endpoints

POST /api/deposit/pix/create

Create a PIX QR code for depositing Brazilian Reais and receiving PIXC tokens.

// Request
{
  "solanaAddress": "HMzRd7wD2R2...",
  "amountBRL": 50.00
}

// Response
{
  "qrCode": "00020126...",
  "pixKey": "...",
  "expiresAt": "2026-06-07T12:30:00Z"
}

🔒 Security Model

Word Finance is a non-custodial wallet. Private keys are generated and stored on the user's device. The security model ensures no transaction happens without explicit user consent.

OperationPIN RequiredVisual Confirmation
webln.enable()NoYes — site name shown
webln.sendPayment()YesYes — amount + destination
webln.makeInvoice()NoYes — amount shown
webln.signMessage()YesYes — message shown
solana.connect()NoYes — site name shown
solana.signTransaction()YesYes — TX details shown
solana.signMessage()YesYes — message shown
solana.signAndSendTransaction()YesYes — TX details shown
🔐
No auto-signing. Word Finance never signs or sends transactions without the user's explicit PIN entry. This is an inviolable security rule — even internal ecosystem apps must follow it.

Compatibility

Platform / ProtocolStatusNotes
BTCPay Server✅ CompatibleVia WebLN — auto-detected
Fountain (podcasts)✅ CompatibleVia WebLN
Nostr apps (Damus, Snort)✅ CompatibleVia WebLN + LNURL-auth
Jupiter Aggregator✅ CompatibleVia Solana Adapter
Raydium✅ CompatibleVia Solana Adapter
Magic Eden✅ CompatibleVia Solana Adapter
Any Phantom-compatible dApp✅ CompatibleisPhantom: true
Any WebLN-compatible site✅ Compatiblewindow.webln standard
WalletConnect / Reown🔜 Coming SoonQR code pairing
EVM chains (Ethereum, Polygon)🔜 Coming SoonRequires ETH key derivation

PIXC Token Info

PropertyValue
NamePIXCOIN (PIXC)
NetworkSolana Mainnet
Token StandardSPL Token
Mint AddressAJAb19vFHfZg1Bs4eYkL2NXjHeuRXNPG8wry8p1f26fq
Decimals2
ValueUtility token; no fixed BRL parity or redemption guarantee
MechanismMint on deposit, burn on withdrawal
Fee0.5% platform fee on transactions
⚠️
PIXC is not a stablecoin. It is a utility token for compatible Word Finance ecosystem and partner experiences. Value and availability may vary; there is no fixed parity, reserve guarantee or redemption promise.