Replies: 3 comments 2 replies
-
Not happening. A canonical, parsimonious binary representation and codec for chain data that is 100% guaranteed to be both backwards and forwards compatible with all correct node implementations is a core requirement of a blockchain. This is not something you can afford to outsource -- one careless misstep in a 3rd party codec library would spell disaster for us.
We already have tier-1 support in Rust and Javascript (TypeScript). Are there others for which there is a pressing need? Perhaps the Foundation can create a grant for them?
We seem to be doing this without difficulty.
The ongoing maintenance burden for the codec is actually very minimal. In fact, once a codec is written and used in a consensus-critical code path, it cannot be modified (so no further work may be done on it). The bulk of ongoing codec work is in adding support for new messages, which would have to happen anyway regardless of library choice.
I think it's a good idea to split the codec logic for Stacks data into its own crate, if that would unblock any of these tasks. |
Beta Was this translation helpful? Give feedback.
-
Hmm yeah, good point.
Ah, nice, perhaps we missed the TS support. Could you point me to where I can find it or learn more about it? A good idea could be to publish a client library outside of this repo that is easily accessible and maintainable so others can use it (e.g. published to npm). We could use the work we did for Stacks Scout, for example. I'm not aware of active projects for other languages that might need them right now but it would be helpful to have a way to generate (or port) libraries for them in the future, if possible.
I see. The most difficult thing for us was to figure out the correct spec from Rust code and SIP text, but maybe a reasonable solution to that would be to maintain a document under this repo's |
Beta Was this translation helpful? Give feedback.
-
perhaps a good opportunity to improve documentation |
Beta Was this translation helpful? Give feedback.
-
The SIP-003 and SIP-005 control-plane and data-plane wire formats were manually implemented in the Stacks node using plain Rust code on top of the node's custom HTTP client.
While this works well for the purposes of the Stacks network, it makes it very hard for other developers to build apps that want to inspect, use, or build on top of these messages (for example, see the stacks-scout project). In order to do this, there's a lot of manual work involved to write extensive (and in many cases boilerplate) code for serialization and de-serialization, as well as manual debugging to make sure they match the current Stacks node implementation (which is not 100% reflected in SIP-005 and SIP-003).
I suggest a better approach would be to refactor this code to make the wire formats portable, preferably using a widely-available and open source standard such as:
This would make a few things much easier:
Beta Was this translation helpful? Give feedback.
All reactions