From 1cdb2421449e9f06f4206ada6925f489c6719376 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Mon, 17 Nov 2025 14:38:26 +0100 Subject: [PATCH 1/3] feat(cardano): Mark optional fields in TxOutput hierarchy optional in proto definition --- proto/utxorpc/v1beta/cardano/cardano.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/proto/utxorpc/v1beta/cardano/cardano.proto b/proto/utxorpc/v1beta/cardano/cardano.proto index ff22309..1b121c9 100644 --- a/proto/utxorpc/v1beta/cardano/cardano.proto +++ b/proto/utxorpc/v1beta/cardano/cardano.proto @@ -27,7 +27,7 @@ message TxInput { bytes tx_hash = 1; // Hash of the previous transaction. uint32 output_index = 2; // Index of the output in the previous transaction. TxOutput as_output = 3; // Content of the input represented as output of the related transaction - Redeemer redeemer = 4; // Redeemer for the Plutus script. + optional Redeemer redeemer = 4; // Redeemer for the Plutus script. } // Represents a transaction output in the Cardano blockchain. @@ -35,14 +35,14 @@ message TxOutput { bytes address = 1; // Address receiving the output. BigInt coin = 2; // Amount of ADA in the output. repeated Multiasset assets = 3; // Additional native (non-ADA) assets in the output. - Datum datum = 4; // Plutus data associated with the output. - Script script = 5; // Script associated with the output. + optional Datum datum = 4; // Plutus data associated with the output. + optional Script script = 5; // Script associated with the output. } message Datum { bytes hash = 1; // Hash of this datum as seen on-chain - PlutusData payload = 2; // Parsed Plutus data payload - bytes original_cbor = 3; // Original cbor-encoded data as seen on-chain + optional PlutusData payload = 2; // Parsed Plutus data payload + optional bytes original_cbor = 3; // Original cbor-encoded data as seen on-chain } // Represents a custom asset in the Cardano blockchain. From 26029e7efa00310e7bd223722766b71b47b1a0c9 Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Mon, 17 Nov 2025 14:39:43 +0100 Subject: [PATCH 2/3] feat(cardano): Add Plutus V4 fields to proto definition --- proto/utxorpc/v1beta/cardano/cardano.proto | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proto/utxorpc/v1beta/cardano/cardano.proto b/proto/utxorpc/v1beta/cardano/cardano.proto index 1b121c9..336fa66 100644 --- a/proto/utxorpc/v1beta/cardano/cardano.proto +++ b/proto/utxorpc/v1beta/cardano/cardano.proto @@ -287,6 +287,7 @@ message Script { bytes plutus_v1 = 2; // Plutus V1 script. bytes plutus_v2 = 3; // Plutus V2 script. bytes plutus_v3 = 4; // Plutus V3 script. + bytes plutus_v4 = 5; // Plutus V4 script. } } @@ -592,6 +593,7 @@ message CostModels { CostModel plutus_v1 = 1; CostModel plutus_v2 = 2; CostModel plutus_v3 = 3; + CostModel plutus_v4 = 4; } message VotingThresholds { @@ -759,6 +761,7 @@ message CostModelMap { CostModel plutus_v1 = 1; CostModel plutus_v2 = 2; CostModel plutus_v3 = 3; + CostModel plutus_v4 = 4; } // Unified Genesis configuration containing all parameters from all eras From fe25af5f8e0886e7a355ea402e91f590ea06f03d Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Tue, 18 Nov 2025 09:36:14 +0100 Subject: [PATCH 3/3] chore(cardano): Add comments to `BigInt` and `TreasuryWithdrawalsAction.withdrawals` --- proto/utxorpc/v1beta/cardano/cardano.proto | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/proto/utxorpc/v1beta/cardano/cardano.proto b/proto/utxorpc/v1beta/cardano/cardano.proto index 336fa66..88a4d44 100644 --- a/proto/utxorpc/v1beta/cardano/cardano.proto +++ b/proto/utxorpc/v1beta/cardano/cardano.proto @@ -152,7 +152,7 @@ message HardForkInitiationAction { } message TreasuryWithdrawalsAction { - repeated WithdrawalAmount withdrawals = 1; // A map of the withdrawals to make + repeated WithdrawalAmount withdrawals = 1; // A list of the withdrawals to make bytes policy_hash = 2; } @@ -245,11 +245,13 @@ message Constr { } // Represents a big integer for Plutus data in Cardano. +// The representation here follows CBOR specification for bignums: +// https://www.rfc-editor.org/rfc/rfc8949.html#name-bignums section 3.4.3. message BigInt { oneof big_int { - int64 int = 1; - bytes big_u_int = 2; - bytes big_n_int = 3; + int64 int = 1; // Stores value fitting within int64 range + bytes big_u_int = 2; // Stores unsigned value exceeding int64 range + bytes big_n_int = 3; // Stores negative value `n` exceeding int64 range as `-1 - n` } }