shard-sdk is a CLI tool designed to streamline the creation of simple based rollups on Celestia using a minimal template.
There is no bloat.
There are no features.
Because of the architectural simplicity of based rollups, all you need to implement is the verification and processing of transactions, as well as state management.
Examples here
We use just
as a task runner. After cloning the repo, run the following command to install the binary.
just install
shard init [rollup-name]
If no project name is provided, the default project name is “my-rollup”.
This will create a new transaction type with the specified fields and prepares both the transaction and state handling code automatically. Make sure you are in the rollup directory before you’re using shard create-tx ...
shard create-tx <tx-name> [field_name field_type]...
For example:
shard create-tx SendMessage msg String user String
After creating a new transaction type, you'll need to:
- Update the
verify()
method insrc/tx.rs
to add your custom validation logic - Modify the
process()
method to implement the transaction logic
To start a local celestia network, run
just celestia-up
After installing the binary for your rollup, you can run
my-rollup-name serve
If you have enabled signature verification, you will need to use signers. Generating signers to use with your rollup is easy:
my-rollup-name create-signer user1
Let's say you used the SendMessage
transaction type example above. To send a transaction, you can run:
my-rollup-name submit-tx send-message --key-name user1 --nonce 0 "Here is my message!" "Ryan"
You can omit the --key-name
if signature verification is disabled, and --nonce
if you haven't implemented nonce controls.
Signature verification is disabled by default to allow for quick experimentation.
To enable it, change SIGNATURE_VERIFICATION_ENABLED
in your-rollup/src/tx.rs
to true
.
Nonce control is also not implemented by default. To prevent replay attacks, ensure processed transactions increment an account nonce. See example here [COMING SOON].
- Implement State as trait to not need to copy syncing logic
- Provide hooks for block processing, e.g.
OnRecvCelestiaBlock(ExtendedHeader)
- Improve UX for adding webserver endpoints, provide examples
- Provide examples for nonce control
- ZK template with sp1
- Integrate prism sdk
- Fully move to lumina once ready
- Ship with an in browser light node for zk template