sui-walrus
Use when storing or retrieving files using Walrus — SUI's decentralized blob storage. Triggers on "Walrus", "blob storage", "upload file to chain", "decentralized storage", "store NFT image", "IPFS alternative on SUI", "where to store NFT metadata", "host a site on-chain", or any off-chain data storage needs on SUI. Also use for Walrus Sites (decentralized web hosting), storing game assets, media files, or when the user asks "where do I put large files on SUI".
Best use case
sui-walrus is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when storing or retrieving files using Walrus — SUI's decentralized blob storage. Triggers on "Walrus", "blob storage", "upload file to chain", "decentralized storage", "store NFT image", "IPFS alternative on SUI", "where to store NFT metadata", "host a site on-chain", or any off-chain data storage needs on SUI. Also use for Walrus Sites (decentralized web hosting), storing game assets, media files, or when the user asks "where do I put large files on SUI".
Teams using sui-walrus should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/sui-walrus/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How sui-walrus Compares
| Feature / Agent | sui-walrus | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when storing or retrieving files using Walrus — SUI's decentralized blob storage. Triggers on "Walrus", "blob storage", "upload file to chain", "decentralized storage", "store NFT image", "IPFS alternative on SUI", "where to store NFT metadata", "host a site on-chain", or any off-chain data storage needs on SUI. Also use for Walrus Sites (decentralized web hosting), storing game assets, media files, or when the user asks "where do I put large files on SUI".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# SUI Walrus Integration
**Decentralized blob storage for NFTs, media, and large files.**
## SDK Versions
Targets: `@mysten/walrus` 1.1.7 (^1.1), `@mysten/sui` 2.17.0 (^2.16). Tested: 2026-05-20.
**Compatibility notes:** `@mysten/walrus@1.x` declares `@mysten/sui ^2.16.0` as a peer dependency. Do not install on top of a sui 1.x project — npm will pull a second sui copy and you will get dual-`SuiClient` type errors. The walrus JS SDK only works against `SuiGrpcClient` / `SuiJsonRpcClient` from sui 2.x. Run `npm ls @mysten/sui` first — if 1.x is present, decide before installing: upgrade the project to sui 2.x, or stay on legacy walrus tooling (CLI only).
## Overview
Walrus provides:
- Decentralized blob storage (images, videos, metadata)
- Content-addressable storage (immutable blob IDs)
- High availability through erasure coding
- Integration with SUI Move contracts
## Use Cases
- NFT metadata and images
- Game assets and textures
- Document storage
- Media CDN
- DApp static assets
## Quick Start
There are two integration paths. Use the **JS SDK** for in-app uploads (browser/Node) where the user pays for their own storage. Use **publishers/aggregators** (HTTP) when you want the lightest client — most apps should start there. The CLI is for local tooling and ops.
### JS SDK (recommended for apps)
```bash
npm install @mysten/walrus @mysten/sui
```
Setup — extend a sui 2.x client with the walrus plugin:
```typescript
import { SuiGrpcClient } from '@mysten/sui/grpc';
import { walrus } from '@mysten/walrus';
const client = new SuiGrpcClient({
network: 'testnet',
baseUrl: 'https://fullnode.testnet.sui.io:443',
}).$extend(walrus());
```
Read a blob:
```typescript
// @check:skip
const bytes = await client.walrus.readBlob({ blobId });
```
Write a blob (requires a `Signer` and SUI for gas + WAL for storage fees):
```typescript
// @check:skip
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
const signer = Ed25519Keypair.fromSecretKey(/* ... */);
const { blobId } = await client.walrus.writeBlob({
blob: new Uint8Array(/* ... */),
deletable: false,
epochs: 3,
signer,
});
```
For crash-recoverable uploads use `writeBlobFlow` / `writeFilesFlow` (see the package README — the flow API exposes `register` / `upload` / `certify` steps with `onStep` and `resume` hooks). Catch `RetryableWalrusClientError` to reset cached state on epoch changes.
> Reading/writing raw blobs through the SDK requires hundreds to thousands of node requests per blob. For high-traffic apps, prefer the upload-relay or publishers/aggregators path.
### Install Walrus CLI
```bash
# Install Walrus CLI
cargo install walrus-cli
# Configure network
walrus config --network testnet
```
### Upload Blob
```bash
# Upload file to Walrus
walrus upload myimage.png
# Returns blob ID: bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
```
### Store Blob ID in Move
```move
module nft::metadata {
use sui::object::{Self, UID};
use std::string::String;
public struct NFT has key, store {
id: UID,
name: String,
walrus_blob_id: vector<u8>, // Store blob ID
}
public fun create_nft(
name: String,
walrus_blob_id: vector<u8>,
ctx: &mut TxContext
): NFT {
NFT {
id: object::new(ctx),
name,
walrus_blob_id,
}
}
public fun metadata_url(nft: &NFT): String {
// Construct Walrus URL
string::utf8(b"walrus://")
.append(string::utf8(nft.walrus_blob_id))
}
}
```
## Frontend Integration
### Upload from Browser
Use the real `@mysten/walrus` extension on a v2 Sui client (see the `$extend(walrus())` examples earlier in this file). There is no separate `@walrus-sdk/client` package — that name is fabricated. A minimal upload + Move-call pattern looks like:
```typescript
// @check:skip
import { SuiGrpcClient } from '@mysten/sui/grpc';
import { walrus } from '@mysten/walrus';
import { Transaction } from '@mysten/sui/transactions';
const client = new SuiGrpcClient({
network: 'testnet',
baseUrl: 'https://fullnode.testnet.sui.io:443',
}).$extend(walrus());
async function uploadNFTMetadata(file: File, signer) {
const bytes = new Uint8Array(await file.arrayBuffer());
const { blobId } = await client.walrus.writeBlob({
blob: bytes,
deletable: false,
epochs: 5,
signer,
});
const tx = new Transaction();
tx.moveCall({
target: `${PACKAGE_ID}::nft::create_nft`,
arguments: [tx.pure.string('My NFT'), tx.pure.string(blobId)],
});
return blobId;
}
```
### Retrieve and Display
```tsx
function NFTImage({ blobId }: { blobId: string }) {
const url = `https://walrus-testnet.storage/${blobId}`;
return <img src={url} alt="NFT" />;
}
```
## Best Practices
- Store blob ID (32 bytes) in Move, not full URL
- Upload metadata and images separately
- Use IPFS CID format for compatibility
- Implement retry logic for uploads
- Cache blob IDs for quick access
## Common Mistakes
❌ **Storing full URL in Move contract**
- **Problem:** URLs change, wastes storage (200+ bytes vs 32 bytes)
- **Fix:** Store only blob ID, construct URL in frontend
❌ **No retry logic on upload failure**
- **Problem:** Network failures break user experience
- **Fix:** Implement exponential backoff retry (3-5 attempts)
❌ **Uploading without checksum verification**
- **Problem:** Silent corruption, blob ID mismatch
- **Fix:** Verify blob ID matches uploaded content hash
❌ **Hardcoding Walrus gateway URLs**
- **Problem:** Gateway changes break all URLs
- **Fix:** Use environment variables for gateway URLs
❌ **Not handling large file uploads**
- **Problem:** Browser memory issues, upload timeout
- **Fix:** Implement chunked upload for files >10MB
Query latest Walrus docs via the in-repo `sui-docs-query` skill (not an SDK function — invoke the skill from Claude Code with args like `type=docs target=walrus query="blob upload API and storage patterns"`).
## See Also
- [advanced-apis.md](references/advanced-apis.md) — Read when working with WalrusFile/WalrusBlob, batching small files via quilts (`encodeQuilt`), converting blob IDs (int ↔ string), or needing network package-config constants (walrus ≥1.1.7)
---
**Decentralized, permanent storage for your SUI NFTs and dApps!**Related Skills
sui-zklogin
Use when implementing zkLogin on SUI — OAuth login (Google, Facebook, Apple, Twitch) with zero-knowledge proofs for privacy-preserving authentication. Triggers on "zkLogin", "social login on SUI", "Google login", "OAuth", "ephemeral keypair", "JWT proof", or any authentication flow that derives a SUI address from an OAuth provider. Also use when the user mentions "login without wallet extension".
sui-wallet
Use when performing on-chain transactions (transfer, Move call, publish) through the agent's CLI wallet via MCP tools. Triggers on "transfer SUI", "call Move function", "publish package", "wallet status", "sign transaction", or any agent-driven on-chain operation. This is for headless/backend wallet operations — for browser wallet UI (React/Vue), use sui-frontend instead.
sui-tester
Use when writing Move tests, setting up test suites, running gas benchmarks, or planning test strategy for SUI contracts. Triggers on "write tests", "test this module", "#[test]", "test coverage", "gas benchmark", "property-based test", or any Move testing task. Use even for simple "how do I test this function" questions.
sui-suins
Use when integrating SuiNS (SUI Name Service) — resolving .sui names to addresses, reverse lookups, or registering names. Triggers on "SuiNS", ".sui name", "name resolution", "reverse lookup", "human-readable address", or any name service integration. Also use when the user wants to display user-friendly names instead of hex addresses.
sui-security-guard
Use when setting up security scanning, detecting leaked secrets/API keys, implementing pre-commit hooks, or auditing a Sui Move contract for security/architecture/quality issues. Triggers on "security scan", "detect secrets", "pre-commit hook", "security audit setup", "API key leaked", and on contract-level review requests like "audit this contract", "review access control", "is this Move safe", "check for vulnerabilities", "Move security review" — these load the SEC/DES/PAT/TST/QA/CFG finding registry in references/move-security-findings.md. For offensive/adversarial testing (attack vector discovery, writing exploits/PoCs), use sui-red-team instead. For Move style/idiom quality (non-security), use move-code-quality.
sui-seal
Use when implementing data encryption, access control, or secrets management on SUI using the Seal protocol. Triggers on threshold encryption, data privacy, token-gated content, encrypted storage, decryption policies, paywall, gated access, encrypted NFT metadata, private data sharing, or any scenario requiring on-chain access control for off-chain data. Also use when the user mentions Seal, pay-to-decrypt, "only NFT holders can see", or subscriber-only content on SUI.
sui-red-team
Use when performing adversarial security testing on SUI Move contracts — generating attack tests for access control bypass, integer overflow, object manipulation, economic exploits, reentrancy, and DoS vectors. Triggers on "red team", "attack test", "find vulnerabilities", "exploit", "pentest", "security test", or when the user wants to stress-test their contract's security. For defensive security setup (scanning, hooks, checklists), use sui-security-guard instead.
sui-passkey
Use when implementing WebAuthn passkeys or biometric authentication (Face ID, fingerprint, hardware keys) on SUI. Triggers on "passkey", "WebAuthn", "biometric login", "Face ID", "fingerprint auth", "FIDO2", or passwordless auth that uses device authenticators instead of seed phrases. Different from zkLogin (which uses OAuth providers).
sui-nautilus
Use when building verifiable off-chain computation, integrating external APIs with on-chain proof, or running trusted execution environments on SUI. Triggers on Nautilus, off-chain oracle, "verify API data on-chain", "connect external API to Move", "prove off-chain result", trusted compute, AWS Nitro Enclave, attestation, price feed, weather data on-chain, or any scenario requiring cryptographically verified external data. Also use when the user asks "how do I get real-world data into my SUI contract" or needs an oracle-like pattern.
sui-kiosk
Use when building NFT marketplaces, enforcing royalties, or managing transfer policies using SUI's Kiosk standard. Triggers on "Kiosk", "NFT marketplace", "transfer policy", "royalty enforcement", "list NFT for sale", "purchase rules", or any NFT commerce on SUI. Also use when the user asks about listing, delisting, or trading NFTs with enforced rules.
sui-install
Use when installing or updating the Sui CLI, managing CLI versions with suiup, or resolving environment/setup problems — "install sui", "update sui", "command not found", "sui not found", "client/server api version mismatch", build errors about "old dependencies", switching CLI versions per network, or installing toolchain components (Walrus, MVR, Move Analyzer, site-builder). Also use for first-time client setup, getting faucet tokens, recovering keys from a phrase, or "Cannot find gas coin for signer address". For deploying/upgrading packages use sui-deployer; for on-chain data queries use sui-ts-sdk.
sui-indexer
Use when building custom indexers, data pipelines, or event processors for the SUI blockchain. Triggers on "indexer", "data pipeline", "backfill", "event processor", "index transactions", "analytics dashboard", "aggregate on-chain data", "historical query", "track all trades", or any custom data extraction from SUI chain history. Also use when the user needs to build dashboards from on-chain data, process historical transactions, or set up real-time event streams.