Store a file in the XRP Ledger

Your token’s picture or any other file, written into the same ledger as the token and read back checked against its fingerprint.

The Windows app that writes your files into the ledger.

The cubes show the chunks of a real file as they are read from the ledger. When every block has been checked against its fingerprint, the file itself appears beside them.

Links to metadata die

When an NFT, an MPT, a DID or a credential keeps its picture and description off the ledger, the ledger entry holds only a link. The file sits on IPFS, on the issuer’s own server or in an S3 bucket.

  • IPFS without pinningPinning stops being paid for, and the file drops out of IPFS.
  • A closed serverThe company shuts down or moves, and the address answers with an error.
  • A closed bucketThe storage account is closed, and the files go with it.

That entry stays in the ledger, but the file behind its link can be lost. With xrpl-file the file is written into the same ledger, in transactions that cannot be changed or deleted, and anyone can check it against its fingerprint without trusting a server. The xrpl-file link is 84 bytes, and an NFT’s URI field holds 256.

From a file to a link, and back

  1. A file on the left; on the right, the chunks it is cut into, drawn as cells.

    Cut into chunks

    The file is cut into pieces called chunks, 1000 bytes each.

  2. Three chunks, each inside its own transaction.

    Written as transactions

    Each chunk is written into its own transaction, in the memo field.

  3. Two groups of chunks, each reduced to one hash. Both hashes lead to a single manifest.

    Fingerprinted

    Every 1024 chunks form a block, and the block’s hash goes into a block list. One last transaction, the manifest, holds the fingerprint of the whole list. The hash of that transaction is the link.

  4. A grid of verified chunks that together form a picture.

    Read and checked

    Anyone with the link gets the chunks from an XRP Ledger node, assembles the file and checks every block against its fingerprint. A file that does not match its fingerprint is not shown. This site’s server takes no part in it.

What it costs

A file goes into the ledger as roughly one transaction per kilobyte, sent from a publishing account in the app. One account can publish any number of files, and when you no longer need it, the app closes it. There are two kinds of cost. Fees are spent. The account's reserve is held while the account exists, and most of it comes back when the account is closed.

The price table is not available right now. The figures are also in the data file, price.json.

Permanent and public

It cannot be deleted

What is written into the ledger stays there. Nobody can delete or change it, you and we included.

Anyone can read it

Anyone can read the file. The data of the ledger is open to everyone, and the link is not a secret.

Publish only what you are glad to show the whole world for good: not a password, not personal data, not a picture you have no right to share.

For developers

The specification describes the format. The repository has a .NET library and a reader for the browser.

Show a file on your page

Add the script and the element. The script is pinned to version 1.2.0 and checked against its integrity value: if the file changes, the browser does not run it.

From npm, through jsDelivr

<script src="https://cdn.jsdelivr.net/npm/xrpl-file-element@1.2.0/xrpl-file-element.js"
        integrity="sha384-3Ng6D0oyDdNcgbs1hTua5zQaHdn4E/3o7gnxr0ecp2jVh2kP2KbJymnO++iWWvP+"
        crossorigin="anonymous" defer></script>
<xrpl-file src="xrpl-file://mainnet/9B1A9E33DBD9B445BFE2854D4D489DC860869D873AD36DA30A69DD19DDBC0DF5"></xrpl-file>

width and height set the size, loading says when reading starts, theme sets the light or dark palette, and node names the node to read from. The full list is in the README: Embed a file.