npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@x1scroll/permastake-sdk

v0.2.0

Published

SDK for PermaStake — permanent document storage with staking yield on X1

Downloads

323

Readme

@x1scroll/permastake-sdk

Permanent document storage with staking yield on X1.

Stamp your data on-chain. Your rent earns staking rewards while it lives. Claim rewards anytime — data stays alive. Nuclear exit when you're done — rent comes back.

Program: 3C112FmQdrctJ3STAEuzohawJQikofDfuFHLQCMES3wy
Network: X1 Mainnet

Install

npm install @x1scroll/permastake-sdk

How It Works

Stamp document:
  Your data → gzip compress → AES-256-GCM encrypt
      → PermaData (permanent bytes on X1)
      → PermaStake (rent staked to validator, earns yield)

Claim yield (anytime):
  stake_balance - original_rent = rewards
  70% → you | 20% → protocol | 10% burned
  Data alive. Stake continues.

Nuclear exit (your choice):
  Deactivate → wait one epoch → withdraw everything
  Get back: original rent + all unclaimed rewards
  Data gone. That's the only delete.

Quick Start

import { PermaStake } from '@x1scroll/permastake-sdk';
import { Keypair } from '@solana/web3.js';

const wallet = Keypair.fromSecretKey(yourSecretKey);
const sdk    = new PermaStake({ wallet, network: 'x1-mainnet' });

// Stamp a document (compress + encrypt + store + stake in one tx)
const result = await sdk.stamp({
  data: Buffer.from('your document content here'),
});

console.log('Store PDA:  ', result.storePda);
console.log('Stake PDA:  ', result.stakePda);
console.log('Rent staked:', result.originalRent, 'XNT');
console.log('TX:         ', result.tx);

Claim Yield

// Check available yield
const status = await sdk.getYieldStatus(result.storeId);
console.log('Available yield:', status.availableYield, 'XNT');
console.log('Your share:     ', status.userShare, 'XNT (70%)');

// Claim it (data untouched, stake keeps earning)
const sig = await sdk.claimYield(result.storeId);

Nuclear Exit

// Step 1 — deactivate stake
await sdk.deactivate(result.storeId);

// Wait one epoch (~2-3 hours on X1)...

// Step 2 — close store, get everything back
await sdk.closeStore(result.storeId);
// Rent + all unclaimed rewards returned to your wallet.
// Data permanently erased.

Validator Choice

import { PublicKey } from '@solana/web3.js';

// Default: x1scroll validator (we earn commission)
await sdk.stamp({ data: myDoc });

// Custom validator: you choose
await sdk.stamp({
  data: myDoc,
  validatorOverride: new PublicKey('YourValidatorVoteAccount...'),
});

// Either way: 70/20/10 yield split applies on claim

Fee Schedule

| Action | Fee | Notes | |--------|-----|-------| | Stamp | 0.06 XNT | + rent (rent goes to stake, not lost) | | Update | 0.01 XNT | Stake untouched | | Claim yield | Free | 70% yours, 20% treasury, 10% burned | | Close | Free | Rent returned |


API

new PermaStake(options)

const sdk = new PermaStake({
  wallet: Keypair,            // required
  network: 'x1-mainnet',     // or full RPC URL
});

stamp(opts)StampResult

Compress + encrypt + store + stake in one transaction.

const result = await sdk.stamp({
  data: Buffer | string,          // your content
  storeId?: bigint,               // defaults to Date.now()
  encrypt?: boolean,              // default true
  validatorOverride?: PublicKey,  // default x1scroll
});
// result.storeId, storePda, stakePda, contentHash, originalRent, tx

getYieldStatus(storeId)YieldStatus

Check available yield without claiming.

claimYield(storeId)string (tx sig)

Harvest rewards. Data alive. Stake continues.

deactivate(storeId)string

Step 1 of nuclear exit. Sets stake to deactivating.

closeStore(storeId)string

Step 2. Close everything. Rent + rewards returned.

getStoreRecord(storeId)StoreRecord | null

Fetch on-chain store metadata.


Links

  • Program: 3C112FmQ...
  • x1scroll.io: https://x1scroll.io
  • GitHub: https://github.com/x1scroll-io/permastake-sdk