-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop support for JSON encoded transactions #1213
Comments
After having spent some time working on a Chess game DApp for Hydra, I am now convinced of the benefits of a proper JSON API over a CBOR one, at least for UTxO-related interactions. Being able to commit a JSON-formatted UTxO through the HTTP interface, and being able to extract information from JSON-formatted UTxO from the Head protocol, is very useful as it alleviates the need for the client to be aware of all the details of the CBOR formatting of those UTxOs. In general, a JSON API is much more versatile from a client perspective, notably because it allows those clients to pick and choose what they support, for example ignoring some parts of a data structure they don't care about and using symbolic references (eg. field names) instead of having to be aware of all the details of the structure's layout as in CBOR. There's support for JSON-schema based documentation and even code generation, which might not be stellar but is still better than what's available for CBOR. And it's always easier for a client to drop to raw JSON handling. I think we should continue to push for first-class support of such an interface in the cardano ecosystem, and for example improve on Cardanonical, and/or propose/use canonical JSON schema for cardano-ledger data structures. What I think is the most glaring issue right now is the lack of proper versioning of the serialised data, whether it's persisted on disk or exchanged across the network of nodes or through the interfaces we provide:
This can be easily done by extending these data structures with a generic |
Discussion from tactical:
|
I realized that we also should contribute a PR to |
This should actually become a 💬 |
We decided not to include |
Why
What
Migrate how we store and share Transactions as JSON everywhere
Tx
JSON representations have the transaction data ascborHex
(see ADR)NewTx
websocket command and/cardano-transaction
HTTP endpoint accept transactions as objects with acborHex
field (nothing else required)txId
is present, it must match the transaction body hash/commit
response andTxValid
,TxInvalid
etc. websocket messages are compatible withcardano-cli transaction
commands and also contain atxId
Ensure our maintained hydra clients and integrations still work
hydra-tui
andhydraw
(in the same repo)hydra-poll
andhydra-chess
(maintained by us, different repos)kupo
indexing of a hydra head (we originally contributed and is affected)Out of scope: Any changes to UTxO (as initially drafted in the ADR)
How
The text was updated successfully, but these errors were encountered: