hydra icon indicating copy to clipboard operation
hydra copied to clipboard

SDK for wallet integration with Hydra

Open rezabaram opened this issue 1 year ago • 1 comments
trafficstars

Why

We would like to enable users and applications hosted in Hydra head (i.e. in the L2) to perform typical operations as in a web3 applications, such as perform connecting a wallet, query balance and submit transactions to spend things. Currently, the only way to perform such operations is through low level interactions with the Hydra node's API and no easy way for developers of web based applications to implement these.

What

Within this feature we want to take first step in this direction and focus on the interaction with UTxO one owns in an already open Hydra Head.

  • Extend MeshJS to support interacting with the hydra-node directly to build transactions

    • This requires an open Hydra head
    • The SDK needs to be provided with connection info to a hydra-node
    • Query the UTXO set of a head
    • Construct and submit transactions into the head (L2 cardano transactions via NewTx)
  • ~~Extend Nami (or an other straightforward) with this SDK to perform the operations mentioned above.~~

  • Create a minimalistic web page, that shows balance in a head and can construct & sign a transaction using a CIP-30 connected wallet.

  • Update Hydraw to not need the backend component

  • Out of scope: Integrated experience where the wallet knows about the Hydra head(s).

How

  • Might want to see whether someone else isn't doing this already
  • Hacked together prototype for a lucid provider in hydra-doom: https://github.com/cardano-scaling/hydra-doom/blob/main/src/lucid-provider-hydra.ts
  • Another stab at a websocket connection we took on hydra-poll: https://github.com/cardano-scaling/hydra-poll/tree/main/src/lib/hydra-ws

Open questions

  • How exactly are we pointing to a hydra-node?
  • Discover hydra heads / nodes for a head?

rezabaram avatar Jul 16 '24 09:07 rezabaram