Skip to content

Commit

Permalink
chore(cardano): rename Catalyst to governance
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmisiak committed Oct 7, 2022
1 parent ca43683 commit a559a72
Show file tree
Hide file tree
Showing 18 changed files with 165 additions and 162 deletions.
16 changes: 8 additions & 8 deletions common/protob/messages-cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ enum CardanoPoolRelayType {

enum CardanoTxAuxiliaryDataSupplementType {
NONE = 0;
CATALYST_REGISTRATION_SIGNATURE = 1;
GOVERNANCE_REGISTRATION_SIGNATURE = 1;
}

enum CardanoCatalystRegistrationFormat {
enum CardanoGovernanceRegistrationFormat {
CIP15 = 0;
CIP36 = 1;
}
Expand Down Expand Up @@ -360,21 +360,21 @@ message CardanoTxWithdrawal {
/**
* @embed
*/
message CardanoCatalystRegistrationDelegation {
message CardanoGovernanceRegistrationDelegation {
required bytes voting_public_key = 1;
required uint32 weight = 2;
}

/**
* @embed
*/
message CardanoCatalystRegistrationParametersType {
message CardanoGovernanceRegistrationParametersType {
optional bytes voting_public_key = 1;
repeated uint32 staking_path = 2;
required CardanoAddressParametersType reward_address_parameters = 3;
required uint64 nonce = 4;
optional CardanoCatalystRegistrationFormat format = 5 [default=CIP15];
repeated CardanoCatalystRegistrationDelegation delegations = 6; // mutually exclusive with voting_public_key; max 32 delegations
optional CardanoGovernanceRegistrationFormat format = 5 [default=CIP15];
repeated CardanoGovernanceRegistrationDelegation delegations = 6; // mutually exclusive with voting_public_key; max 32 delegations
optional uint64 voting_purpose = 7;
}

Expand All @@ -384,7 +384,7 @@ message CardanoCatalystRegistrationParametersType {
* @next CardanoTxAuxiliaryDataSupplement
*/
message CardanoTxAuxiliaryData {
optional CardanoCatalystRegistrationParametersType catalyst_registration_parameters = 1;
optional CardanoGovernanceRegistrationParametersType governance_registration_parameters = 1;
optional bytes hash = 2;
}

Expand Down Expand Up @@ -452,7 +452,7 @@ message CardanoTxItemAck {
message CardanoTxAuxiliaryDataSupplement {
required CardanoTxAuxiliaryDataSupplementType type = 1;
optional bytes auxiliary_data_hash = 2;
optional bytes catalyst_signature = 3;
optional bytes governance_signature = 3;
}

/**
Expand Down
12 changes: 6 additions & 6 deletions common/tests/fixtures/cardano/sign_tx.failed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@
}
},
{
"description": "transaction with catalyst registration containing byron reward address",
"description": "transaction with governance registration containing byron reward address",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -1309,7 +1309,7 @@
"certificates": [],
"withdrawals": [],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"voting_public_key": "3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7",
"staking_path": "m/1852'/1815'/0'/2/0",
"nonce": 22634813,
Expand Down Expand Up @@ -1348,7 +1348,7 @@
}
},
{
"description": "transaction with both auxiliary data blob and catalyst registration",
"description": "transaction with both auxiliary data blob and governance registration",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -1359,7 +1359,7 @@
"withdrawals": [],
"auxiliary_data": {
"hash": "ea4c91860dd5ec5449f8f985d227946ff39086b17f10b5afb93d12ee87050b6a",
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"voting_public_key": "38DA0B509D45BF6C87BD55594B92F97081D3923B8C1334B9B8D0BF13FC1C12D0",
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
Expand Down Expand Up @@ -1399,7 +1399,7 @@
}
},
{
"description": "transaction with both voting public key and delegations in catalyst registration",
"description": "transaction with both voting public key and delegations in governance registration",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -1409,7 +1409,7 @@
"certificates": [],
"withdrawals": [],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"voting_public_key": "38DA0B509D45BF6C87BD55594B92F97081D3923B8C1334B9B8D0BF13FC1C12D0",
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
Expand Down
22 changes: 11 additions & 11 deletions common/tests/fixtures/cardano/sign_tx.json
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@
}
},
{
"description": "transaction with CIP15 catalyst registration",
"description": "transaction with CIP15 governance registration",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -1012,7 +1012,7 @@
"certificates": [],
"withdrawals": [],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"voting_public_key": "1af8fa0b754ff99253d983894e63a2b09cbb56c833ba18c3384210163f63dcfc",
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
Expand Down Expand Up @@ -1060,12 +1060,12 @@
"auxiliary_data_supplement": {
"type": 1,
"auxiliary_data_hash": "a943e9166f1bb6d767b175384d3bd7d23645170df36fc1861fbf344135d8e120",
"catalyst_signature": "74f27d877bbb4a5fc4f7c56869905c11f70bad0af3de24b23afaa1d024e750930f434ecc4b73e5d1723c2cb8548e8bf6098ac876487b3a6ed0891cb76994d409"
"governance_signature": "74f27d877bbb4a5fc4f7c56869905c11f70bad0af3de24b23afaa1d024e750930f434ecc4b73e5d1723c2cb8548e8bf6098ac876487b3a6ed0891cb76994d409"
}
}
},
{
"description": "transaction with CIP36 catalyst registration and voting purpose not specified",
"description": "transaction with CIP36 governance registration and voting purpose not specified",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -1075,7 +1075,7 @@
"certificates": [],
"withdrawals": [],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
"addressType": 0,
Expand Down Expand Up @@ -1133,12 +1133,12 @@
"auxiliary_data_supplement": {
"type": 1,
"auxiliary_data_hash": "9d4c00f5b5b67760931fd7ed9850ff8e14dcdf957685191ab4bc755c52f0ed56",
"catalyst_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
"governance_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
}
}
},
{
"description": "transaction with CIP36 catalyst registration and OTHER voting purpose",
"description": "transaction with CIP36 governance registration and OTHER voting purpose",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -1148,7 +1148,7 @@
"certificates": [],
"withdrawals": [],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
"addressType": 0,
Expand Down Expand Up @@ -1203,7 +1203,7 @@
"auxiliary_data_supplement": {
"type": 1,
"auxiliary_data_hash": "28b7ffa6800833bdfe5421739eaa21d4a49cde1d84e762b147001169f7c0a385",
"catalyst_signature": "ebc00c615f988c6fc2e132d4419a719f04bbec56fe2569a00746a9e9b0d6e5bdd0809515cb2522c773c991c5ae39834403654d36b37e70b14897c0e98c8c0a0c"
"governance_signature": "ebc00c615f988c6fc2e132d4419a719f04bbec56fe2569a00746a9e9b0d6e5bdd0809515cb2522c773c991c5ae39834403654d36b37e70b14897c0e98c8c0a0c"
}
}
},
Expand Down Expand Up @@ -1734,7 +1734,7 @@
}
],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
"addressType": 0,
Expand Down Expand Up @@ -1794,7 +1794,7 @@
"auxiliary_data_supplement": {
"type": 1,
"auxiliary_data_hash": "544c9ae849c82e31224865ff936decc6160047409eee4a6b4178b729fe3d286c",
"catalyst_signature": "3064949c9f186138f95e228075d0119dd5cb50e1b7e75d24d569fa547e018a597615da7c79a39ca8e394ee1ba8acb83e70be80f37e69aef3b86e7c4a6bd44903"
"governance_signature": "3064949c9f186138f95e228075d0119dd5cb50e1b7e75d24d569fa547e018a597615da7c79a39ca8e394ee1ba8acb83e70be80f37e69aef3b86e7c4a6bd44903"
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions common/tests/fixtures/cardano/sign_tx.show_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
}
},
{
"description": "transaction with CIP36 catalyst registration and voting purpose not specified",
"description": "transaction with CIP36 governance registration and voting purpose not specified",
"parameters": {
"protocol_magic": 764824073,
"network_id": 1,
Expand All @@ -467,7 +467,7 @@
"certificates": [],
"withdrawals": [],
"auxiliary_data": {
"catalyst_registration_parameters": {
"governance_registration_parameters": {
"staking_path": "m/1852'/1815'/0'/2/0",
"reward_address_parameters": {
"addressType": 0,
Expand Down Expand Up @@ -525,7 +525,7 @@
"auxiliary_data_supplement": {
"type": 1,
"auxiliary_data_hash": "9d4c00f5b5b67760931fd7ed9850ff8e14dcdf957685191ab4bc755c52f0ed56",
"catalyst_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
"governance_signature": "2671b8e668ffce235647ac89deda6cc222e7b31a3d44606c2723fcf711b29f9af1e30b0c6b4f87ba37ddf9f6adf0226c39c09e655255890644a3dc4e64c3a001"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/all_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,12 @@
import trezor.enums.BinanceTimeInForce
trezor.enums.CardanoAddressType
import trezor.enums.CardanoAddressType
trezor.enums.CardanoCatalystRegistrationFormat
import trezor.enums.CardanoCatalystRegistrationFormat
trezor.enums.CardanoCertificateType
import trezor.enums.CardanoCertificateType
trezor.enums.CardanoDerivationType
import trezor.enums.CardanoDerivationType
trezor.enums.CardanoGovernanceRegistrationFormat
import trezor.enums.CardanoGovernanceRegistrationFormat
trezor.enums.CardanoNativeScriptHashDisplayFormat
import trezor.enums.CardanoNativeScriptHashDisplayFormat
trezor.enums.CardanoNativeScriptType
Expand Down
4 changes: 2 additions & 2 deletions core/src/apps/cardano/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ Each transaction may contain auxiliary data. Auxiliary data format can be found

Auxiliary data can be sent to Trezor as a hash or as an object with parameters. The hash will be included in the transaction body as is and will be shown to the user.

The only object currently supported is Catalyst voting key registration. To be in compliance with the CDDL and other Cardano tools, Catalyst voting key registration object is being wrapped in a tuple and an empty tuple follows it. The empty tuple represents `auxiliary_scripts` which are not yet supported on Trezor and are thus always empty. Byron addresses are not supported as Catalyst reward addresses. The Catalyst registration signature is returned in the form of `CardanoTxAuxiliaryDataSupplement` which also contains the auxiliary data hash calculated by Trezor.
The only object currently supported is governance voting key registration (currently, this is used only by Catalyst, but there may be other governance use cases in the future). To be in compliance with the CDDL and other Cardano tools, governance voting key registration object is being wrapped in a tuple and an empty tuple follows it. The empty tuple represents `auxiliary_scripts` which are not yet supported on Trezor and are thus always empty. Byron addresses are not supported as governance reward addresses. The governance registration signature is returned in the form of `CardanoTxAuxiliaryDataSupplement` which also contains the auxiliary data hash calculated by Trezor.

[Catalyst Registration Transaction Metadata Format](https://github.com/cardano-foundation/CIPs/blob/749f22eccd78e05fcdc4552c49639bb3bbd0a458/CIP-0015/CIP-0015.md)
[Governance Registration Transaction Metadata Format](https://cips.cardano.org/cips/cip36/)

### Native scripts

Expand Down
Loading

0 comments on commit a559a72

Please sign in to comment.