Skip to main content

10. Use direct connection to `cardano-node`

· One min read

Status

Accepted

Context

  • On-chain validation is a critical part of the Hydra protocol. It requires both the ability to submit transactions to the layer 1 chain, advancing the state of a head, and observing those transactions as the Plutus contracts are validated.
  • The Plutus Application Framework is expected to provide the necessary machinery to allow 'smart contract' applications to interact with the chain, but it's still under active development and not ready for deployment on-chain.
  • We want to gather feedback as early as possible and deliver a fully functional Hydra Head node for early adopters to test on a 'real' chain (testnet).
  • Our experiment connecting directly to a Cardano node has been conclusive. We can:
    • Connect to a node using local protocols
    • Build and submit Head transactions triggering smart contracts validation
    • Observe transactions using chain-sync protocol.

Decision

Therefore

For the time being, until Plutus Application Framework is released, we will implement on-chain interaction of Hydra nodes directly, connecting to a Cardano node through a local socket.

Consequences

  • Limit Hydra dependencies to the Plutus repository
  • Remove all PAB-related code as well as off-chain contracts code and related dependencies.