Skip to content
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

Raw CBOR datum in transaction outputs #1543

Closed
ch1bo opened this issue Jul 31, 2024 · 6 comments · Fixed by #1684
Closed

Raw CBOR datum in transaction outputs #1543

ch1bo opened this issue Jul 31, 2024 · 6 comments · Fixed by #1684
Assignees
Labels
api Items related to the Hydra client API green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap ux Related to user experience

Comments

@ch1bo
Copy link
Collaborator

ch1bo commented Jul 31, 2024

Why

When building applications that need to spend from a script UTxO in a Hydra head, which has a datum attached, that off-chain code needs access to the raw Datum for evaluating the transaction and calculate fees.

The schema used by the hydra-node right now matches whatever cardano-api provides, while other applications follow other schemas. For example: kupo, ogmios (also see cardanonical) or blockfrost

This item is a backward-compatible change and in further steps we might want to move to one of those.

What

  • Add a inlineDatumRaw to any TxOut sent out by the API, that contains the raw CBOR for any inline datums

How

  • Update the API specification and implementation
@ch1bo ch1bo added the 💭 idea An idea or feature request label Jul 31, 2024
@ch1bo
Copy link
Collaborator Author

ch1bo commented Jul 31, 2024

We encountered this when building https://github.com/cardano-scaling/hydra-doom with @Quantumplation and @yHSJ where we use https://github.com/spacebudz/lucid

@ch1bo ch1bo changed the title Raw CBOR datum in UTxO outputs Raw CBOR datum in transaction outputs Jul 31, 2024
@ch1bo
Copy link
Collaborator Author

ch1bo commented Aug 1, 2024

Related to #1509

@ch1bo ch1bo added the api Items related to the Hydra client API label Aug 20, 2024
@ffakenz ffakenz self-assigned this Sep 10, 2024
@ffakenz ffakenz added the ux Related to user experience label Sep 10, 2024
@ffakenz
Copy link
Contributor

ffakenz commented Sep 11, 2024

PR upstream: IntersectMBO/cardano-api#632

@ch1bo ch1bo added 💬 feature A feature on our roadmap green 💚 Low complexity or well understood feature and removed 💭 idea An idea or feature request labels Sep 17, 2024
@noonio
Copy link
Contributor

noonio commented Sep 18, 2024

@noonio
Copy link
Contributor

noonio commented Sep 30, 2024

Present status:

  • Could be back-ported because of the downstream on plutus 1.32
  • Could do our upgrade of our own dependecies on plutus 1.32; see plutus: 1.30 -> 1.34.1 #1544 .

@ch1bo ch1bo linked a pull request Oct 4, 2024 that will close this issue
4 tasks
@ch1bo ch1bo removed a link to a pull request Oct 4, 2024
4 tasks
@ch1bo
Copy link
Collaborator Author

ch1bo commented Oct 4, 2024

While #1680 allows us to update cardano-api to 9.30 and beyond, the upstream change IntersectMBO/cardano-api#632 is not released yet.

@ch1bo ch1bo linked a pull request Oct 4, 2024 that will close this issue
4 tasks
@ch1bo ch1bo self-assigned this Oct 4, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 7, 2024
We want to update to a recent `cardano-api` version to get #1543 (which
we contributed upstream). This update implied a bump on `plutus-tx` (via
the ledger) and resulted in growing script sizes. At that point we
explored various ways to decrease the script size again to keep the
single transaction publishing and `--hydra-scripts-tx-id` config (or
even expanding that).

This mikado / dependency graph shows our option and the chosen path of
this PR:

![ADRs _ Designs - cardano-api 9 3 update mikado
2024-10-03](https://github.com/user-attachments/assets/52d61e15-0485-4a63-81ce-de4c2f6eeec1)

Concretely this PR contains:

* Update to `cardano-api` version `9.3`

* Rebased and updated to latest `aiken` the commit validator from this
work: #1072

* Support `PlutusV3` validators next to legacy `PlutusV2` validators
(the aiken one is V3)

Consequences of switching to `aiken`:
- 🚀 reduces cost to open (collect) a head, for example 5 parties
from 1.00 -> 0.81 ADA =~ **20% cost saving**
- 🚀 reduces cost to abort a head, for example 5 parties from 1.27
-> 0.85 ADA =~ **50% cost saving**
- 🚀 supports collect transaction with 9 parties (abort 12) = new
maximum number of parties is **8** (tests showed we need some margin)

---

* [x] CHANGELOG updated
* [x] Documentation update not needed
* [x] Haddocks updated
* [x] New TODOs introduced
- One as a reminder that we have duplication of types between
aiken/haskell
@ch1bo ch1bo assigned ch1bo and unassigned ch1bo Oct 8, 2024
github-merge-queue bot pushed a commit that referenced this issue Oct 9, 2024
Addresses #1543 and tests whether
IntersectMBO/cardano-api#632 results in `GET
/snapshot/utxo` to contain `inlineDatumRaw`.

Bonus: First step on consolidating `TxOut` and `UTxO` generators
(deduplicating and moving them to a common module)

TODO: Somehow get
IntersectMBO/cardano-api@17eb46f
into this branch. Most likely requiring #1680 (which updates to most
recent `cardano-api` release `9.30`) and a `source-repository-package`
onto some unreleased cardano-api.

---

* [x] CHANGELOG updated or not needed
* [x] Documentation updated or not needed
* [x] Haddocks updated or not needed
* [x] No new TODOs introduced or explained herafter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Items related to the Hydra client API green 💚 Low complexity or well understood feature 💬 feature A feature on our roadmap ux Related to user experience
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants