Rusty Subbit.xyz
Posted on 2026-08-22
Intro
Changes introduced for and by the recent hardfork broke the stack on which Subbit.xyz was built. It was not entirely clear whether the fixes would be coming upstream soon. The problem was our opportunity to do the unreasonable thing: rewrite it in Rust 🦀!
Why Rust?
Our sister project Konduit, part of Cardano-Lightning, has been maintaining a rust based transaction builder. We have greater awareness of its state of maintenance, we know the code base, and we have the ability to upstream fixes. Its also a language we’re more confident in working in.
Its not without downsides. Leaving JS/TS means leaving the more populous developer ecosystem and adds a barriers for any willing contributor coming from that world. In addition, its been an incredible amount of unintended work. The libraries lack maturity and the aren’t particularly ergonomic in their interfacing with the chain.
A new example
To demonstrate Subbit.xyz in action we have a first example in our new stack.
We start with a very simple application, echo over post.
The client makes and HTTP post request and the server responds with the body of the request.
Very simple.
Now suppose the service provider needs to be remunerated to sustain their excellent work echoing. And to do so without modifying their server code. we’ll call this the echo-server.
Here are the steps for the provider:
- Setup a subbit-server.
- Setup a reverse proxy which sits in front of both the echo-server and the subbit-server.
- Configure the proxy so that a header of any request to the echo server is first send to the subbit server. We’ll call the header the subbit-request header.
For the consumer:
- They sit the echo-client behind a subbit issuer.
- The issuer is used to inject the expected headers in to requests.
- The issuer also extracts the subbit-response headers from the responses.
Now have a new subbit enabled server and subbit enabled client.
The consumer opens a new channel with their and the providers credentials. The provider, via their subbit-index service verifies the new channel and communicates to the subbit-server that the channel exists and has some backing UTXO of specified funds.
Now the provider should accept the consumers request up to the amount backed by the channel.
We have created a demo of the two cases: no subbit, and with subbit. Here we’ve skipped the on-chain bit, and used the mock-index service. Checkout our demos.
Next steps
From a code perspective, we’re missing a few small pieces to round off a
Of course, what we really want it is usage in the wild! Please get in touch if you have questions or think Subbit.xyz is something you can make use of.
A note to reviewers
Our milestone plan had been a little tidying and some education. It certainly had not considered that we’d end up with complete rewrite.
There is a changelog, and a version 0.0.1 is imminent.