Skip to main content
@ckb-ccc/spore implements the Spore Protocol — CKB’s standard for fully on-chain digital objects (DOBs). Spore cells store content entirely on-chain and encode ownership through CKB lock scripts, making them censorship-resistant and permanent. The package exports functions for managing both Spores (individual NFTs) and Clusters (named collections that group Spores together).

Installation

If you install @ckb-ccc/spore directly, import from it:

SporeDataView

Every Spore cell holds a SporeDataView payload that describes its content:

Spore functions

createSpore

Create a new Spore cell and return the signed transaction along with the new Spore ID.

transferSpore

Move an existing Spore to a new owner.

meltSpore

Destroy a Spore and reclaim its CKB capacity.

findSpore

Look up a single Spore by its ID. Returns undefined if not found.

assertSpore

Like findSpore, but throws if the Spore does not exist.

findSpores

Async generator that streams all Spores matching an optional lock script and/or cluster ID.

findSporesBySigner

Async generator that streams all Spores owned by a signer, with optional cluster filter.
Pass clusterId: "" to findSpores or findSporesBySigner to return only public Spores — those not belonging to any cluster.

Cluster functions

Clusters group Spores into named collections. They are singleton cells that carry a name and description.

createSporeCluster

transferSporeCluster

findCluster / assertCluster

findSporeClustersBySigner / findSporeClusters

Async generators for enumerating clusters, equivalent to their Spore counterparts.

Example: create and transfer a Spore

1

Create a Spore

2

Transfer the Spore