@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
- npm
- yarn
- pnpm
@ckb-ccc/spore directly, import from it:
SporeDataView
Every Spore cell holds aSporeDataView 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. Returnsundefined if not found.
assertSpore
LikefindSpore, 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.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