Relysia
Relysia WalletAPI DocumentationGithub RepositoryDemo
  • Relysia SDK
  • Getting Started
    • Setup
    • API
    • Infrastructure
  • Wallets
    • Wallets
    • Mnemonic
    • Addresses
    • Metrics
    • Balance
    • History
  • Payments
    • Lookup
    • Sweep
    • URI
    • Transactions
    • Raw Transactions
    • Invoices
      • Create Invoice
      • Get Invoice
      • Pay Invoice
    • Payments
    • Asm
  • token
    • Basics
    • Token Issuance
    • NFT Issuance
    • Atomic Swaps
    • Details
    • Leaderboard
  • Utility
    • Post
    • Upload
    • Conversion
    • Paymail
    • Transpile-Compile
  • Enterprise Wallet
    • Overview
    • Authentication
    • Management
    • Wallet
    • Smart Contracts
    • Transaction
    • Fee Manager
    • Events
  • Realtime Transaction Notification
    • Use Case
    • Setup and Configuration
    • Events and Messages
  • More
    • Metashard
    • Satolearn
Powered by GitBook
On this page
  1. Utility

Upload

Upload Data to the Blockchain

PreviousPostNextConversion

Last updated 2 years ago

Every transaction on the blockchain is a data bundle. Instead of integrating locking and unlocking scripts to the UTXO, one can also upload arbitrary data.

A common use case for uploads is to store NFT images or videos in protocol format directly on-chain instead of on a server, to ensure the long term availability of the media file.

Our media /upload endpoint is currently available via API to seamlessly upload files.

We currently support uploads up to 20MB on the production server and keep extending the limits. In our prototypes we recently successfully uploaded >1GB files.

Blockchain File Upload.

POST https://api.relysia.com/upload

The /upload endpoint broadcasts a media file (supplied as URL) to the blockchain (in B:// protocol format).

Headers

Name
Type
Description

walletID

string

Request Body

Name
Type
Description

fileUrl*

string

fileName*

string

{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "Data uploaded Successfully",
    "uploadObj": {
      "fileName": "Relysia Test nft image size 1 kb.",
      "fileType": "image",
      "fileSize": 1121,
      "timeStamp": "2022-09-19T09:24:10.808Z",
      "txid": "f6c830f25f84ba14ef9cdef76dcf16934a9693b9acadd6573d759e8104fa38d8",
      "address": "1BuEAp4mjJdeDGcpw6XdvtA9fWmHNF2mMX",
      "addressPath": "m/44'/0'/0'/0/0",
      "url": "B://f6c830f25f84ba14ef9cdef76dcf16934a9693b9acadd6573d759e8104fa38d8"
    }
  }
}
var parameters = { 
    serviceId: 'optional',
    walletID: 'optional',
    body: {
          type: "media",
          fileUrl: "https://firebasestorage.googleapis.com/v0/b/musicartdev/o/nftAssets%2F0bb0267f-d5e4-4266-9499-987e2c910451_250x250?alt=media",
          fileName: "nft relysia",
          notes: "max notes text length allowed 100K"
    }
}
const response = await relysia.upload(parameters);

Same shall apply to the /upload endpoint.

pruning considerations
B://cat
Swagger UI
Logo