Integrating Xyra
Xyra is a web-based signing system for XRPL & Xahau. Any website can request a connect session and then request transaction signing. There are no extensions required, and there is no app registration required. Every action requires explicit user approval in Xyra's protected approval environment.
Quick Start
npm install @xyrawallet/sdkConnect Flow
Your app opens Xyra's approval popup at wallet.xyra.now/connect. Xyra derives the requesting origin from document.referrer, prompts the user, and then sends a CONNECT_RESPONSE back via postMessage.
import sdk from '@xyrawallet/sdk';
const { address, network, publicKey } = await sdk.connect({
network: 'xrpl-testnet',
onProgress: (step) => console.log(step)
});
console.log('Address:', address);
console.log('Network:', network);
console.log('PublicKey:', publicKey);Sign Transactions
Xyra supports signing any valid XRPL/Xahau transaction type. By default, transactions are sign-only. You can optionally request sign + submit by using signAndSubmit(). Xyra will clearly display whether a transaction will be submitted or not.
import sdk from '@xyrawallet/sdk';
// Sign only (default behavior)
const { tx_blob, hash } = await sdk.sign({
transaction: {
TransactionType: 'Payment',
Account: address,
Destination: 'rDESTINATION...',
Amount: '1000000',
Fee: '12',
Sequence: accountSequence,
LastLedgerSequence: currentLedger + 20
},
network: 'xrpl-testnet'
});
console.log('Signed TX:', tx_blob);
console.log('Hash:', hash);
// You can submit later using your own RPC endpointWarning: When using signAndSubmit(), Xyra will submit the transaction immediately after signing. Network fees will be spent and the action is irreversible. The approval UI will clearly warn users about this.
import sdk from '@xyrawallet/sdk';
// Sign and submit (requires explicit opt-in)
const { tx_blob, hash, submitted, submitResult } = await sdk.signAndSubmit({
transaction: {
TransactionType: 'Payment',
Account: address,
Destination: 'rDESTINATION...',
Amount: '1000000',
Fee: '12',
Sequence: accountSequence,
LastLedgerSequence: currentLedger + 20
},
network: 'xrpl-testnet'
});
console.log('Signed TX:', tx_blob);
console.log('Hash:', hash);
console.log('Submitted:', submitted); // true
if (submitted && submitResult) {
console.log('Result:', submitResult.engine_result);
console.log('Message:', submitResult.engine_result_message);
}Sign Messages
Sign arbitrary messages for authentication, proof of ownership, or wallet adapter integration. Message signing is network-agnostic and does not require any blockchain interaction or fees.
import sdk from '@xyrawallet/sdk';
// Sign an arbitrary message (network-agnostic)
const { address, signature, publicKey, message } = await sdk.signMessage({
message: 'Sign in to MyApp - Timestamp: 2025-01-15T10:30:00Z',
onProgress: (step) => console.log(step)
});
console.log('Signed by:', address);
console.log('Signature:', signature);
console.log('Public Key:', publicKey);
console.log('Message:', message);
// Verify the signature server-side using the public key
// The signature can be used for authentication or proof of ownership- Prove wallet ownership without sending transactions
- Wallet adapter authentication (sign-in with XRPL)
- Off-chain message verification
- Authentication tokens for web applications
- Cryptographic proof for third-party services
import { verify, deriveAddress } from 'ripple-keypairs';
// Verify signature
const isValid = verify(message, signature, publicKey);
// Verify address matches public key
const derivedAddress = deriveAddress(publicKey);
const addressMatches = derivedAddress === address;
if (isValid && addressMatches) {
// Signature is valid - user owns this address
// Issue auth token, grant access, etc.
}Security Model
Xyra uses an open-origin model. Any website can open the wallet popup. Trust is established by clear, user-visible domain verification inside the wallet UI. Xyra separates signing from broadcasting—transactions are never submitted unless both the application and the user explicitly approve submission.
Networks & Safety
Xyra supports both XRPL and Xahau across Testnet and Mainnet. Network context is always shown to the user in the wallet UI before approval.