Skip to content

Repository files navigation

toju — pay-as-you-go decentralized storage on IPFS

toju is a crypto-native onramp for decentralized storage on IPFS via Storacha. pay with SOL, USDFC, or USDC — no credit cards, no subscriptions. toju also supports agentic payments via the x402 protocol, enabling AI agents to pay for storage autonomously.

Features

  • Native SOL payments for storage — no credit cards, subscriptions, or off-chain billing
  • Filecoin-backed IPFS storage via Storacha, ensuring decentralized, verifiable persistence
  • Pay-as-you-go pricing, lowering friction for real storage usage and experimentation
  • Storage lifecycle management, including automatic cleanup of expired files
  • Email notifications before storage expiration to prevent unintended data loss
  • Developer-friendly SDK and CLI, designed for easy integration into Solana applications

Quick Start

Using the SDK

npm install @toju.network/sol

Direct Usage (Node.js / Server-side)

import{Client,Environment}from'@toju.network/sol';constclient=newClient({environment: Environment.testnet,});// Estimate storage costconstcost=awaitclient.estimateStorageCost([file],30*86400);// 30 days in secondsconsole.log(`Cost: ${cost.sol} SOL`);// Upload a fileconstresult=awaitclient.createDeposit({payer: publicKey,// from wallet adapterfile: [file],durationDays: 30,
signTransaction,// from wallet adapteruserEmail: 'user@example.com',// optional, for expiry notifications});console.log(`File CID: ${result.cid}`);

React Hook

import{useDeposit}from'@toju.network/sol';import{useWallet}from'@solana/wallet-adapter-react';functionUploadComponent(){const{ publicKey, signTransaction }=useWallet();constclient=useDeposit('mainnet-beta',false);consthandleUpload=async(files: File[])=>{constcost=awaitclient.estimateStorageCost(files,30*86400);constresult=awaitclient.createDeposit({payer: publicKey,file: files,durationDays: 30,
signTransaction,});console.log(`Uploaded: ${result.cid}`);console.log("cost",cost)};return(<buttononClick={()=>handleUpload([file])}>Upload</button>);}

Using the Web App

Documentation

Full documentation available at docs.toju.network

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Links

Production (Mainnet):

Staging (Testnet):

Resources:

Talk to us

License

Apache-2.0

Help us Scale

Support Storacha-Solana-SDK on drips.network

About

the onramp for pay-as-you-go decentralized storage on IPFS — SOL, USDFC, USDC, and x402 agent payments

Topics

Resources

Contributing

Security policy

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages