Esta página aún no está disponible en español.

  1. Desarrolladores
  2. Blog de ingeniería

Wallet Address Smart Redirect

Written by Cozmin Ungureanu

When you think of a wallet address, you probably think of a string of characters (or in Open Payments’s case, a neat URL) that acts as a source or destination for payments. For example:

https://ilp.interledger.cards/007

Traditionally, when an Open Payments client queries that address, it receives a structured JSON:

{
"id": "https://ilp.interledger.cards/007",
"publicName": "John Doe",
"assetCode": "EUR",
"assetScale": 2,
"authServer": "https://auth.interledger.cards",
"resourceServer": "https://ilp.interledger.cards"
}

This is perfect for developers and systems that need machine-readable data. But what about people?

If someone clicks that same wallet address in a browser, JSON isn’t exactly a friendly experience. That’s where our new Wallet Address Smart Redirect comes in.


What’s new?

As of v1.1.2-beta, enabling Smart Redirect, Rafiki detects when a request is coming from a browser (using the Accept: text/html header). Instead of showing raw JSON, the request automatically redirects to a user-friendly payment page defined in your environment settings.

For example, when opened in a browser, https://ilp.interledger.cards/007 redirects to: https://interledgerpay.com/payment-choice?receiver=https://ilp.interledger.cards/007

Interledger Payment Page

The result: a single wallet address that works seamlessly for both developers and end-users.


Example in Action

Let’s say Alice wants to send money to Bob.

  1. Bob shares his wallet address: https://ilp.interledger.cards/007
  2. Alice pastes that link into her browser.
  3. Instead of confusing JSON, Alice is redirected straight to Bob’s payment page (configured by the wallet operator).
  4. Alice chooses her payment method and completes the transfer.

Meanwhile, behind the scenes:


Why it matters


Configuration

Enable Wallet Address Smart Redirect by setting a single environment variable:

Terminal window
WALLET_ADDRESS_REDIRECT_HTML_PAGE="https://interledgerpay.com/payment-choice?receiver=%ewa"

Header behavior

URL tokens (drop-in placeholders)

You can compose the redirect URL using these tokens:

TokenWhat it insertsExample redirect templateExample resolved URL (for http://ilp.dev/007)
%waFull wallet address including schemehttp://rafiki.dev/%wahttp://rafiki.dev/http://ilp.dev/007
%ewaURI-encoded full wallet addresshttp://rafiki.dev/?wallet=%ewahttp://rafiki.dev/?wallet=http%3A%2F%2Filp.dev%2F007
%wpHost + path (no scheme)http://rafiki.dev/%wphttp://rafiki.dev/ilp.dev/007
%ewpURI-encoded host + path (no scheme)http://rafiki.dev/?wallet=%ewphttp://rafiki.dev/?wallet=ilp.dev%2F007

How to use it

  1. Set WALLET_ADDRESS_REDIRECT_HTML_PAGE in your backend environment variables.
  2. Choose the right token for your redirect style.
  3. That’s it, your wallet addresses now double as developer endpoints and payment links.

Looking ahead

Wallet Address Smart Redirect is another step toward making Rafiki wallets more accessible, discoverable, and user-friendly. Whether you’re a developer integrating APIs or a user just trying to send money, one address now does it all.


Como somos de código abierto, puedes revisar fácilmente nuestro trabajo en GitHub. Si el trabajo mencionado aquí te inspiró, tus contribuciones son bienvenidas. Puedes unirte a nuestro Slack de la comunidad o participar en la próxima llamada comunitaria, que se celebra el segundo miércoles de cada mes.

Si quieres mantenerte al día con todas las oportunidades abiertas y noticias de la Fundación Interledger, puedes suscribirte a nuestro boletín.