PotDrive
Open Drive

Concepts

One-signature uploads

A 30-block upload needs 30 store extrinsics. PotDrive asks your wallet once.

The problem

Each block must be its own store extrinsic (see why). A browser wallet pops up once per signature. Forty prompts for a small website is not a product.

The flow

BrowserWalletUpload keyPortaldotprepare: chunk, hash, DAG (no network)listStored(): which blocks are already heldsign batchAll[transferKeepAlive, revive.call]1 extrinsic: fund key + register rootstore(block 1) … store(block n), own noncesbitswap_v1_get(root) → re-hashtransferAll(owner): unspent budget back
One approval from the wallet; every other transaction is signed by the throwaway upload key.
  1. Prepare. The browser chunks, hashes and builds the DAG. No network, no keys.
  2. Estimate. One state read finds blocks Portaldot already holds. Two paymentInfo calls give the linear fee model. The budget is the fees for new blocks plus 15%, two sweep fees and two existential deposits.
  3. Authorize. PotDrive generates an sr25519 key from a fresh mnemonic, in memory. Your wallet signs one utility.batchAll: balances.transferKeepAlive(uploadKey, budget), plus revive.call(registry, register(…)) if the registry is deployed. Ownership is recorded under your account, not the key's.
  4. Store. The upload key sends one store per new block. It pre-assigns nonces and keeps four in flight, and reports each block's inclusion block and transaction index from the Stored event.
  5. Verify. PotDrive fetches the root back with bitswap_v1_get and re-hashes it.
  6. Sweep. The key sends its entire remaining balance back with balances.transferAll.
An upload in progress: one approval, then block-by-block storage

Safety of the upload key

Blast radius

The key only ever holds the budget for this upload, and only until the sweep a few blocks later. It has no proxy rights and no registry rights. It is a funded throwaway.

Closed tabs

Before funding, the mnemonic is written to localStorage with the owner and root. If the tab closes mid-upload, the Drive finds it next time and offers to return the balance. Blocks already stored stay on chain, and re-uploading the same file skips them because they dedupe.

recover
import { recoverSession } from "@potdrive/sdk";
await recoverSession(api, mnemonic, ownerAddress); // transferAll back to the owner

Progress events

EventWhen
estimateFees, reused and new bytes, budget, total.
sessionThe upload key's address, before funding.
authorizedThe single wallet transaction is in a block.
blockEvery status change of every block: queued, skipped, sent, inBlock, finalized, failed.
verifiedThe root came back over bitswap and matched its hash.
sweptUnspent budget returned.
doneThe result: root CID, private key if any, block placements.

Edit this page on GitHub