Skip to main content

Spore Examples

Here we provide several examples which are minimum viable snippets designed for a Node environment, each showcasing a specific feature implemented using the Spore SDK.

These examples serve as practical guides for developers, demonstrating how to implement specific features in a straightforward manner, for instance, how to create a spore by a transaction with spore-sdk. And for those who are looking for documentation on how to develop a fully functional application, refer to: Spore Demos.

Scenario examples​

Creating your first spore on-chain​

Spore-first-example is a hello world example for spore-sdk, showing you how to upload an image file and create a spore on Nervos CKB in a split second. This is a well-suited code example for beginners to learn the very basics of Spore Protocol.

Lock script examples​

CKB default lock​

CKB default lock is the most commonly used lock script on Nervos CKB, also a great starting point for beginners due to its simplicity. Let's check out some examples using the CKB Default lock:

Anyone-can-pay​

Anyone-can-pay (ACP) lock can be unlocked by anyone without signature verification and accepts any amount of CKB/UDT payment for using the cluster. Check out these code examples:

Omnilock​

Omnilock is a universal and interoperable lock script supporting various blockchains (Bitcoin, Ethereum, EOS, etc.) verification methods and extensible for future additions. Combine Omnilock with spore-sdk to: