CKB Script Port: testing state transfer between light clients

I’ve been working on a small experiment called CKB Script Port.

The idea is to see whether already-synced state for one CKB Script can be moved from one light-client installation to another, so the new installation does not always have to rebuild the same Script history from scratch.

I first tested this with Pocket Node, and later with iBytes.

While testing the iBytes setup, I ran into an interesting light-client case.

A Script can be synced up to a certain block height even when the light-client database does not have the exact block hash for that height stored locally.

That matters for Script Port because if I want another light client to continue from that point, I need a boundary I can actually verify. I didn’t want to solve that by simply trusting a hash from an external RPC.

So I tested using the light client’s existing block-proof verification path to verify that historical block instead.

That worked, and I was able to complete the handoff on the iBytes setup and continue syncing from the next block.

The Script Port repo is here:

The historical-header part also became an upstream ckb-light-client contribution:

I’m still treating Script Port as an experiment, not as something every wallet necessarily needs.

But this was one of the more interesting things I found while testing the idea, so I thought it was worth sharing.

The CKBuilder discussion is here too:

5 Likes

Did you hit any issue when testing with Pocket Node.

1 Like

Not really on Pocket itself. The Pocket test actually went pretty smoothly once I got into the light-client state.
I was able to move the Script state to a fresh install, continue from the next block, and it still worked after restart.
The weird issue came later when I tested with iBytes, not Pocket.

1 Like

Thank you, I’ll look more into it and this will be one of the features to introduce down the line

2 Likes

That’s great to hear, thanks bro. I’ll keep you posted as the upstream side moves.

will really make sense if syncs on new devices/installs can continue from where the last install stopped without having to do it all over from scratch. excited for your next update.

1 Like