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

Implement deposit validators and off-chain code #1574

Closed
Tracked by #199
noonio opened this issue Aug 19, 2024 · 1 comment · Fixed by #1580
Closed
Tracked by #199

Implement deposit validators and off-chain code #1574

noonio opened this issue Aug 19, 2024 · 1 comment · Fixed by #1580
Assignees
Labels
task Subtask of a bigger feature.

Comments

@noonio
Copy link
Contributor

noonio commented Aug 19, 2024

Why

Given the new deposit workflow of #199, we would like to implement the fairly independent steps of depositing and canceling independent of the hydra-node. Such that this work can be tested and merged independently.

TODO: Why doing this separate to #1522?

What

  • Can create Hydra deposit transactions from command line

    • Supports only one version of the scripts, that is the hydra-plutus version that is compiled into it
    • Input:
      • UTxO to deposit
      • HeadId?
      • Deadline?
    • Result: Transaction envelope on disk and the TxIn of the created deposit on stdout
    • i.e. hydra-tx deposit <utxo> <headid> <deadline>
  • Can create Hydra recover transactions from command line

    • Input:
      • Transaction input of the deposit to recover
      • Transaction output of the deposit to recover (at least the datum and value)
      • Current time as a slot (used for lower validity bound)
    • i.e. hydra-tx recover <utxo> <txin> <slot>

TBD: Out of scope?

  • TBD: Are transactions produced by hydra-tx balanced (fees paid)?

  • TBD: hydra-tx does NOT do any communication whatsoever.

  • TBD: Too big? Move all hydra protocol transaction creation, into a package with command line interface, and also include mutation and end-to-end tests

    • Blackbox testing of hydra-tx
    • hydra-node uses hydra-tx library for building transactions

How

  • TODO: Does the architecture change by doing this? Do we want do do this in this item?

ADRs _ Designs - hydra-tx lib + cli 2024-08-19

  • How to use it with cardano-cli roughly:
    cardano-cli query utxo --address "addr_..." > utxo.json
    hydra-tx deposit --utxo utxo.json \
      --deposit-txin "b7765b081a1ac48a3751346cfd0758116ec170c63a9de31380556ba311e73faa#0" \
      --head-id "1231241" \
      --deadline $(($(date --date "2 hours" +"%s"))) \
      --out-file tx.json
    
    # TBD: Does not exist. Contribute? Similar functionality in cardano-api?
    cardano-cli transaction balance \
      --protocol-parameters ... \ # Can change every epoch
      --system-start ... \        # Never change for network
      --epoch-info ... \          # May change in between hard-forks
      --unbalanced-tx tx.json \
      --cardano-signing-key fuel.sk \
      --out-file tx.json
    cardano-cli transaction submit --tx-file tx.json
@noonio noonio mentioned this issue Aug 19, 2024
10 tasks
@noonio noonio added the task Subtask of a bigger feature. label Aug 19, 2024
@ch1bo ch1bo removed their assignment Aug 20, 2024
@noonio noonio linked a pull request Aug 27, 2024 that will close this issue
@v0d1ch
Copy link
Contributor

v0d1ch commented Aug 30, 2024

Question: What about the fees? The fees are not mentioned for the deposit/recover transactions. Since the user is responsible for submitting we also need to take into account setting the fees since we are constructing the transaction. User could be able to import the tx cbor into their wallet but idea here was that we provide some compatibility with cardano-cli. Perhaps we could set minimum fees and/or provide argument to the hydra-tx executable to set the desired fee (this looks more feasible than importing the tx into wallet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Subtask of a bigger feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants