hydra-tx
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Tx.Fanout

Synopsis

Creation

fanoutTx Source #

Arguments

:: ScriptRegistry

Published Hydra scripts to reference.

-> UTxO

Snapshotted UTxO to fanout on layer 1

-> Maybe UTxO

Snapshotted commit UTxO to fanout on layer 1

-> Maybe UTxO

Snapshotted decommit UTxO to fanout on layer 1

-> (TxIn, TxOut CtxUTxO)

Everything needed to spend the Head state-machine output.

-> SlotNo

Contestation deadline as SlotNo, used to set lower tx validity bound.

-> PlutusScript

Minting Policy script, made from initial seed

-> Either Text Tx 

Create the fanout transaction, which distributes the closed state accordingly. The head validator allows fanout only > deadline, so we need to set the lower bound to be deadline + 1 slot.

partialFanoutTx Source #

Arguments

:: ScriptRegistry

Published Hydra scripts to reference.

-> UTxO

Subset of UTxOs to distribute in this partial fanout

-> (TxIn, TxOut CtxUTxO)

Head state-machine output to spend

-> SlotNo

Contestation deadline as SlotNo, used to set lower tx validity bound.

-> FanoutProgressDatum

FanoutProgressDatum from the current head output (the caller converts ClosedDatum if needed)

-> HydraAccumulator

Remaining accumulator after removing the distributed subset

-> Tx 

Create a partial fanout transaction that distributes a subset of UTxOs and produces a FanoutProgress head output with an updated accumulator. Handles both Closed → FanoutProgress (first step) and FanoutProgress → FanoutProgress (subsequent steps).

The continuing head output is the first output, followed by the distributed UTxOs. No tokens are burned (that happens on the final full fanout).

finalPartialFanoutTx Source #

Arguments

:: ScriptRegistry

Published Hydra scripts to reference.

-> UTxO

All remaining UTxOs to distribute in this final fanout

-> HydraAccumulator

Accumulator the head output's datum commits to, i.e. exactly the UTxOs distributed here. The membership proof is against this, so the caller passing the accumulator it already verified against the datum is what makes the on-chain identity A = P_distribute * G1 hold.

-> (TxIn, TxOut CtxUTxO)

Head state-machine output to spend

-> SlotNo

Contestation deadline as SlotNo, used to set lower tx validity bound.

-> PlutusScript

Minting Policy script, made from initial seed

-> Either Text Tx 

Create the final partial fanout transaction that distributes all remaining UTxOs and burns all head tokens. Transitions FanoutProgress → Final.

Observation

data FanoutObservation Source #

Constructors

FanoutObservation 

Fields

Instances

Instances details
FromJSON FanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

ToJSON FanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

Generic FanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

Associated Types

type Rep FanoutObservation :: Type -> Type Source #

Show FanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

Eq FanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

type Rep FanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

type Rep FanoutObservation = D1 ('MetaData "FanoutObservation" "Hydra.Tx.Fanout" "hydra-tx-2.4.1-6u9wd83eS2xF3WS9TuJN93" 'False) (C1 ('MetaCons "FanoutObservation" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "fanoutUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO)))

observeFanoutTx Source #

Arguments

:: UTxO

A UTxO set to lookup tx inputs

-> Tx 
-> Maybe FanoutObservation 

Identify a fanout tx by lookup up the input spending the Head output and decoding its redeemer.

data PartialFanoutObservation Source #

Constructors

PartialFanoutObservation 

Fields

Instances

Instances details
FromJSON PartialFanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

ToJSON PartialFanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

Generic PartialFanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

Associated Types

type Rep PartialFanoutObservation :: Type -> Type Source #

Show PartialFanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

Eq PartialFanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

type Rep PartialFanoutObservation Source # 
Instance details

Defined in Hydra.Tx.Fanout

type Rep PartialFanoutObservation = D1 ('MetaData "PartialFanoutObservation" "Hydra.Tx.Fanout" "hydra-tx-2.4.1-6u9wd83eS2xF3WS9TuJN93" 'False) (C1 ('MetaCons "PartialFanoutObservation" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "distributedOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO)))

observePartialFanoutTx Source #

Arguments

:: UTxO

A UTxO set to lookup tx inputs

-> Tx 
-> Maybe PartialFanoutObservation 

Identify a partial fanout tx by looking up the input spending the Head output and decoding its redeemer as PartialFanout.

observeFinalPartialFanoutTx Source #

Arguments

:: UTxO

A UTxO set to lookup tx inputs

-> Tx 
-> Maybe FanoutObservation 

Identify a final partial fanout tx by looking up the input spending the Head output and decoding its redeemer as FinalPartialFanout. Returns a FanoutObservation since this is the finalizing step.