Transactions

·

Transactions are the fundamental mechanism for modifying the state of the XRP Ledger. Every change — from sending payments to updating account settings — must be executed through a transaction. These transactions become permanent only after being signed, submitted, and accepted into a validated ledger via the decentralized consensus process. Even failed transactions are recorded, as they still impact the network by consuming transaction costs designed to prevent spam.

Beyond simple fund transfers, transactions in the XRP Ledger support a wide range of functionalities, including key management, trading on the built-in decentralized exchange, and configuring account permissions. The rippled API provides a comprehensive list of available transaction types, enabling developers and users to interact with the ledger securely and efficiently.


How Transactions Work

Each transaction begins as an unsigned JSON object containing essential fields such as the sender (Account), destination, amount, fee, and sequence number. Once properly constructed, it must be digitally signed using cryptographic keys associated with the sending account. This signature proves authorization and ensures immutability — once signed, no part of the transaction can be altered without invalidating the signature.

After submission to a rippled server, the transaction enters a provisional state where it's relayed across the peer-to-peer network. Through the consensus protocol, validators agree on which transactions to include in the next ledger version. If confirmed, the transaction is applied in canonical order and becomes part of a validated ledger, making its results final and irreversible.

Finality Tip: A transaction is only truly final when it appears in a validated ledger. Provisional confirmations are not guarantees.

Identifying and Verifying Transactions

Every successfully submitted transaction receives a unique transaction hash — a 64-character hexadecimal string that serves as a permanent identifier. This hash allows anyone to look up the transaction’s details and verify its outcome, acting as a tamper-proof proof of payment.

You can retrieve transaction history using the account_tx command or check individual results with the tx method via the WebSocket or HTTP APIs.

👉 Learn how to securely sign and submit transactions with advanced tools

⚠️ Note on Hash Uniqueness: While transaction hashes are generally unique, two early SetFee pseudo-transactions shared the same hash due to identical fields. Since then, newer implementations include a LedgerSequence field to ensure uniqueness.

Understanding Transaction Costs

Even failed transactions incur a small transaction cost, denominated in XRP. This design choice supports network integrity by discouraging spam and denial-of-service attacks. The fee is destroyed (not transferred), so it does not benefit any party.

Why charge for failed transactions?

These fees fall under the tec (transaction error code) category and are justified as part of the ledger's anti-abuse framework.


Authorization Methods

A transaction must be authorized by one of several cryptographic methods:

Any signature type can authorize most transaction types, with exceptions:

For enhanced security, consider rotating keys regularly or implementing multi-signing policies.

👉 Explore secure wallet practices that protect your transactions


Step-by-Step: Signing and Submitting

Submitting a transaction involves several precise steps:

  1. Construct an unsigned transaction in JSON format.
  2. Sign it using your private key (locally, for security).
  3. Submit the signed blob to a rippled server via WebSocket or HTTP.
  4. Wait for consensus confirmation.
  5. Verify inclusion in a validated ledger.

Here’s an example of an unsigned Payment transaction:

{
  "TransactionType": "Payment",
  "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJyn2Jpn",
  "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
  "Amount": {
    "currency": "USD",
    "value": "1",
    "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJyn2Jpn"
  },
  "Fee": "12",
  "Flags": 2147483648,
  "Sequence": 2
}

Once signed, this becomes a binary transaction blob ready for submission:

{
  "id": 2,
  "command": "submit",
  "tx_blob": "120000240000000461D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000F732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74483046022100982064CDD3F052D22788DB30B52EEA8956A32A51375E72274E417328EBA31E480221008F522C9DB4B0F31E695AA013843958A10DE8F6BA7D6759BEE645F71A7EB240BE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754"
}

After execution, the ledger returns metadata detailing all state changes — account balances, trust lines, and final outcomes like tesSUCCESS.


Frequently Asked Questions

What happens if my transaction fails?

Failed transactions are still recorded in the ledger. While they don’t perform their intended action (e.g., sending money), they consume the transaction cost (fee) to deter abuse.

How do I know if my transaction is final?

A transaction is final only when it appears in a validated ledger. Use the tx command to check its status and confirm "validated": true.

Can I cancel a pending transaction?

No. If a transaction hasn’t been confirmed, you can't cancel it directly. However, you may replace it by submitting a new transaction with the same sequence number and higher fee.

What is a transaction hash used for?

The hash uniquely identifies a transaction and enables public verification. It serves as cryptographic proof of submission and outcome.

Why does every transaction need a sequence number?

Sequence numbers ensure transactions are processed in order and prevent replay attacks. Each account starts at Sequence: 1, incrementing with each submitted transaction.

What is a pseudo-transaction?

Pseudo-transactions are system-generated entries (like fee updates) that aren’t signed by users but still require consensus approval. They appear in ledgers like regular transactions.


Core Keywords

👉 Get started with reliable transaction handling using trusted infrastructure