Skip to content

Commit

Permalink
feat(cardano): update transaction signing for multisig
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielKerekes committed Oct 6, 2021
1 parent af504c5 commit a59cb87
Show file tree
Hide file tree
Showing 25 changed files with 3,113 additions and 244 deletions.
22 changes: 18 additions & 4 deletions common/protob/messages-cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ enum CardanoTxAuxiliaryDataSupplementType {
enum CardanoTxSigningMode {
ORDINARY_TRANSACTION = 0;
POOL_REGISTRATION_AS_OWNER = 1;
MULTISIG_TRANSACTION = 2;
}

enum CardanoTxWitnessType {
Expand Down Expand Up @@ -193,6 +194,7 @@ message CardanoSignTxInit {
required bool has_auxiliary_data = 10;
optional uint64 validity_interval_start = 11;
required uint32 witness_requests_count = 12;
required uint32 minting_asset_groups_count = 13;
}

/**
Expand Down Expand Up @@ -230,7 +232,8 @@ message CardanoAssetGroup {
*/
message CardanoToken {
required bytes asset_name_bytes = 1; // asset name as bytestring (may be either ascii string or hash)
required uint64 amount = 2; // asset amount
optional uint64 amount = 2; // asset amount
optional sint64 mint_amount = 3; // mint amount (can also be negative in which case the tokens are burnt)
}

/**
Expand Down Expand Up @@ -288,18 +291,20 @@ message CardanoPoolParametersType {
*/
message CardanoTxCertificate {
required CardanoCertificateType type = 1; // certificate type
repeated uint32 path = 2; // BIP-32 path to derive (staking) key
repeated uint32 path = 2; // stake credential key path
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
}

/**
* Request: Transaction withdrawal data
* @next CardanoTxItemAck
*/
message CardanoTxWithdrawal {
repeated uint32 path = 1;
repeated uint32 path = 1; // stake credential key path
required uint64 amount = 2;
optional bytes script_hash = 3; // stake credential script hash
}

/**
Expand All @@ -322,6 +327,14 @@ message CardanoTxAuxiliaryData {
optional bytes hash = 2;
}

/**
* Request: Transaction mint
* @next CardanoTxItemAck
*/
message CardanoTxMint {
required uint32 asset_groups_count = 1;
}

/**
* Response: Acknowledgement of the last transaction item received
* @next CardanoTxInput
Expand All @@ -334,6 +347,7 @@ message CardanoTxAuxiliaryData {
* @next CardanoTxWithdrawal
* @next CardanoTxAuxiliaryData
* @next CardanoTxWitnessRequest
* @next CardanoTxMint
*/
message CardanoTxItemAck {
}
Expand Down Expand Up @@ -442,7 +456,7 @@ message CardanoSignTx {

message CardanoTokenType {
required bytes asset_name_bytes = 1; // asset name as bytestring (may be either ascii string or hash)
required uint64 amount = 2; // asset amount
required uint64 amount = 2; // asset amount
}

/**
Expand Down
3 changes: 2 additions & 1 deletion common/protob/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ enum MessageType {
MessageType_CardanoPoolOwner = 328 [(wire_in) = true];
MessageType_CardanoPoolRelayParameters = 329 [(wire_in) = true];
MessageType_CardanoGetNativeScriptHash = 330 [(wire_in) = true];
MessageType_CardanoNativeScriptHash = 331 [(wire_in) = true, (wire_out) = true];
MessageType_CardanoNativeScriptHash = 331 [(wire_out) = true];
MessageType_CardanoTxMint = 332 [(wire_in) = true];

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

0 comments on commit a59cb87

Please sign in to comment.