basharddocs
Open app
Use

Storage: tapes, tracks and shards

How objects are reserved, encoded, uploaded, certified, downloaded and expired.

Storage in Bashard is reserved up front as a tape, then filled with tracks. Every track is erasure-coded into 20 shards by your client before anything leaves your device.

Tapes

A tape is a prepaid reservation: capacity MB × epochs × price, paid in BSHD. The payment is not handed to anyone at once. It is scheduled per epoch, and each epoch's share is paid to that epoch's committee, weighted by stake, when the epoch closes.

  • Quote: the contract computes the cost for a given capacity and duration before you commit.
  • Extend: add epochs to an existing tape.
  • Expand: add capacity in MB for the remaining epochs.

Prices are set by protocol parameters on the deployed contracts. This documentation does not state a price because no production deployment exists.

Tracks

A track is one object inside a tape, addressed by a numeric track id and also findable by tape and key. The tape's owner can delete a track, which frees capacity and lets nodes garbage-collect the shards.

Encoding and commitments

  1. The client splits the file with a Reed-Solomon (20, 7) code into 20 shards.
  2. Each shard is cut into 1 KiB leaves. The shard root is the merkle root over those leaves.
  3. The track root is the merkle root over the 20 shard roots.
  4. The client calls registerTrack with the root and size. Only this commitment goes on chain.

Upload and certification

Shard i of track t is sent to committee seat (keccak(t) + i) mod committeeSize. With a full committee of 20 each node holds one shard; with fewer nodes, some nodes hold several. Each holder checks its shard against the on-chain root and returns a signature. With signatures from at least two thirds of the committee, the client calls certifyTrack.

Download

The client reads the track's placement, requests shards from their holders with a merkle proof, verifies each against the on-chain root, and decodes once 7 valid shards arrive. A node that returns bad data is simply skipped.

Expiry and deletion

When a tape's last paid epoch ends, its tracks are no longer owed storage and nodes may garbage-collect them. Extend a tape before it expires if you need the data. Deleting a track is an on-chain action; once nodes observe it, they remove the shards.

Current limits

  • Uploads are encoded in memory; streaming or chunked uploads for very large files are not implemented yet.
  • No network is live, so no tapes or tracks can be created yet.