Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cardano): add support for plutus transactions #2114

Merged
merged 13 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions common/protob/messages-cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ enum CardanoTxSigningMode {
ORDINARY_TRANSACTION = 0;
POOL_REGISTRATION_AS_OWNER = 1;
MULTISIG_TRANSACTION = 2;
PLUTUS_TRANSACTION = 3;
}

enum CardanoTxWitnessType {
Expand Down Expand Up @@ -205,6 +206,10 @@ message CardanoSignTxInit {
required uint32 witness_requests_count = 12;
required uint32 minting_asset_groups_count = 13;
required CardanoDerivationType derivation_type = 14;
optional bool include_network_id = 15 [default=false]; // network id included as tx body item
optional bytes script_data_hash = 16;
required uint32 collateral_inputs_count = 17;
required uint32 required_signers_count = 18;
}

/**
Expand All @@ -225,6 +230,7 @@ message CardanoTxOutput {
optional CardanoAddressParametersType address_parameters = 2; // parameters used to derive the address
required uint64 amount = 3; // amount to spend
required uint32 asset_groups_count = 4;
optional bytes datum_hash = 5;
}

/**
Expand Down Expand Up @@ -305,6 +311,7 @@ message CardanoPoolParametersType {
optional bytes pool = 3; // pool hash
optional CardanoPoolParametersType pool_parameters = 4; // used for stake pool registration certificate
optional bytes script_hash = 5; // stake credential script hash
optional bytes key_hash = 6; // stake credential key hash
}

/**
Expand All @@ -315,6 +322,7 @@ message CardanoTxWithdrawal {
repeated uint32 path = 1; // stake credential key path
required uint64 amount = 2;
optional bytes script_hash = 3; // stake credential script hash
optional bytes key_hash = 4; // stake credential key hash
}

/**
Expand Down Expand Up @@ -345,6 +353,24 @@ message CardanoTxMint {
required uint32 asset_groups_count = 1;
}

/**
* Request: Transaction collateral input data
* @next CardanoTxItemAck
*/
message CardanoTxCollateralInput {
required bytes prev_hash = 1;
required uint32 prev_index = 2;
}

/**
* Request: Transaction required signer
* @next CardanoTxItemAck
*/
message CardanoTxRequiredSigner {
optional bytes key_hash = 1;
repeated uint32 key_path = 2;
}

/**
* Response: Acknowledgement of the last transaction item received
* @next CardanoTxInput
Expand All @@ -358,6 +384,8 @@ message CardanoTxMint {
* @next CardanoTxAuxiliaryData
* @next CardanoTxWitnessRequest
* @next CardanoTxMint
* @next CardanoTxCollateralInput
* @next CardanoTxRequiredSigner
*/
message CardanoTxItemAck {
}
Expand Down
2 changes: 2 additions & 0 deletions common/protob/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ enum MessageType {
MessageType_CardanoGetNativeScriptHash = 330 [(wire_in) = true];
MessageType_CardanoNativeScriptHash = 331 [(wire_out) = true];
MessageType_CardanoTxMint = 332 [(wire_in) = true];
MessageType_CardanoTxCollateralInput = 333 [(wire_in) = true];
MessageType_CardanoTxRequiredSigner = 334 [(wire_in) = true];

// Ripple
MessageType_RippleGetAddress = 400 [(wire_in) = true];
Expand Down
Loading