cardano-rpc
Safe HaskellNone
LanguageHaskell2010

Cardano.Rpc.Server.Internal.UtxoRpc.Type.Byron

Description

Conversion of Byron-era transactions to UTxO RPC messages.

cardano-api's Tx GADT has no Byron constructor, so the conversion works directly on the Byron ledger types.

Synopsis

Documentation

byronBlockTxs :: ABlockOrBoundary ByteString -> [Proto Tx] Source #

Extract the transactions of a Byron block as UTxO RPC Tx messages, in block order.

byronTxToUtxoRpcTx :: ATxAux ByteString -> Proto Tx Source #

Convert a Byron-era transaction to the UTxO RPC Tx message. Populates hash, inputs, outputs, witnesses and successful.

The transaction hash covers the original on-chain annotated bytes (hashDecoded); re-serialising could produce a different encoding and therefore a wrong transaction id.

The fee field is left unset: Byron fees are implicit (inputs minus outputs) and cannot be recovered without resolving the inputs against the UTxO set. successful is always true because Byron has no phase-2 validation. All remaining fields (certificates, withdrawals, minting, validity, collateral, reference inputs, auxiliary data and proposals) have no Byron counterpart and stay empty.

Byron pairs witness i with input i positionally; splitting the witnesses into the proto bootstrapWitnesses and vkeywitness arms does not preserve that pairing, and it cannot be reconstructed from the address alone. Consumers needing per-input authorisation must use native_bytes.