Wallet addresses
Each payment account belonging to your users (e.g., customers) must have at least one associated wallet address for the account to be able to send and receive payments over Interledger and Open Payments. A wallet address serves as a publicly shareable standardized ID for a payment account.
Create wallet addresses
There are a few ways in which you can create wallet addresses.
Create wallet addresses through a script
Writing your own script that loops through your list of account is one way to batch create wallet addresses for your existing account holders.
Ensure your script calls the createWalletAddress
GraphQL mutation.
createWalletAddress mutation
We strongly recommend you store at least the walletAddress.id
in your internal database to be able to reference the account and wallet address later.
Example
Example JSON request
Variable | Description |
---|---|
assetId | The unique ID of the asset, assigned by Rafiki when the asset was created, that the wallet address’s underlying payment account is denominated in |
publicName | The public name associated with the wallet address |
url | The wallet address’s case-insensitive URL |
additionalProperties | Optional additional properties associated with the wallet address |
Example JSON response
Create wallet addresses in response to a webhook event
The wallet_address.not_found
event fires when a wallet address is requested through the Open Payments Get Wallet Address API, but Rafiki can’t find the address.
When you receive the event, look up the associated account in your system, then call the createWalletAddress
mutation to create a wallet address for the account.
The mutation and example JSON request/response is the same as what’s given above.
Create and manage wallet addresses using Rafiki Admin
You can create and manage wallet addresses manually through the Rafiki Admin app.
Create a wallet address key pair
Creating a public-private key pair for each wallet address is not required when integrating with Rafiki.
You only need to create key pairs for wallet addresses if you want to allow your account holders to use/be Open Payments clients under their wallet addresses. For more information, review the Open Payments documentation about clients and client keys.
Use the createWalletAddressKey
GraphQL mutation to create a key pair and associate it with a wallet address.
createWalletAddressKey mutation
Example
Example JSON request
The request is a standard request to create a JSON Web Key (JWK), which is a JSON data structure that represents a cryptographic key. Section 4 of the JWK specification describes the format and associated parameters kty
, alg
, and kid
. Section 6 of the JSON Web Algorithms (JWA) specification describes the cryptographic algorithm for the keys and associated parameters kty
, crv
, and x
.
Open Payments requires the following values.
Parameter | Required value | Description |
---|---|---|
alg | EdDSA | The algorithm used to generate the key pair |
kty | OKP | The key type identifying the cryptographic algorithm family used with the key |
crv | Ed25519 | The cryptographic curve used with the key |
Additionally, the request must contain the walletAddressId
of the wallet address that the key pair will be associated with.
Example JSON response