Skip to content

Commit 959cffa

Browse files
authored
CIP-0021 | Adjust preamble and structure w.r.t CIP-0001 (cardano-foundation#666)
* first draft remediation of CIP-0021 * fixed formatting of sub-sub-subheadings and admonitions * standardised use of "ledger era" as per CIP-0084 * spelled NA instead of standard N/A
1 parent 9edebbe commit 959cffa

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

CIP-0021/README.md

+39-25
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
---
22
CIP: 21
33
Title: Transaction requirements for interoperability with hardware wallets
4-
Authors: Gabriel Kerekes <[email protected]>, Rafael Korbas <[email protected]>, Jan Mazak <[email protected]>
54
Status: Active
6-
Type: Informational
5+
Category: Wallets
6+
Authors:
7+
- Gabriel Kerekes <[email protected]>
8+
- Rafael Korbas <[email protected]>
9+
- Jan Mazak <[email protected]>
10+
Implementors: N/A
11+
Discussions:
12+
- https://github.com/cardano-foundation/CIPs/pull/107
713
Created: 2021-06-15
814
License: CC-BY-4.0
915
---
@@ -12,7 +18,7 @@ License: CC-BY-4.0
1218

1319
This CIP describes all the restrictions applicable to Cardano transactions which need to be signed by hardware wallets.
1420

15-
## Motivation
21+
## Motivation: why is this CIP necessary?
1622

1723
Due to certain limitations of hardware (abbrev. HW) wallets, especially very small memory and a limited set of data types supported by Ledger, HW wallets are not able to process all valid transactions which are supported by Cardano nodes.
1824

@@ -26,7 +32,7 @@ To ensure interoperability, SW wallets and other tools working with HW wallets s
2632

2733
Certain transaction elements, described as allowed in this document, might not be supported by some HW wallets. Support also depends on HW wallet firmware or app versions. If transaction signing fails for a transaction which is built according to this specification, make sure to check the documentation of the HW wallet you are using.
2834

29-
_It might take some time for recent Cardano ledger spec changes to be implemented for HW wallets. Thus it might happen that further restrictions might apply on top of the restrictions mentioned in this CIP until the changes are implemented on HW wallets._
35+
> **Note:** It might take some time for recent Cardano ledger spec changes to be implemented for HW wallets. Thus it might happen that further restrictions might apply on top of the restrictions mentioned in this CIP until the changes are implemented on HW wallets.
3036
3137
### Canonical CBOR serialization format
3238

@@ -41,15 +47,15 @@ See the RFC for details.
4147

4248
### Transaction body
4349

44-
**Unsupported entries**
50+
#### Unsupported entries
4551

4652
The transaction body entry `6 : update` must not be included.
4753

48-
**Integers**
54+
#### Integers
4955

5056
HW wallets support at most `int64` for signed integers and `uint64` for unsigned integers i.e. larger integers are not supported overall. Additionally, any integer value must fit in the appropriate type.
5157

52-
**Numbers of transaction elements**
58+
#### Numbers of transaction elements
5359

5460
The number of the following transaction elements individually must not exceed `UINT16_MAX`, i.e. 65535:
5561

@@ -66,27 +72,27 @@ The number of the following transaction elements individually must not exceed `U
6672
- reference inputs in transaction body
6773
- the total number of witnesses
6874

69-
**Optional empty lists and maps**
75+
#### Optional empty lists and maps
7076

7177
Unless mentioned otherwise in this CIP, optional empty lists and maps must not be included as part of the transaction body or its elements.
7278

73-
**Outputs**
79+
#### Outputs
7480

75-
A new, "post Alonzo", output format has been introduced in the Babbage era which uses a map instead of an array to store the output data. For now, both the "legacy" (array) and "post Alonzo" (map) output formats are supported by HW wallets but we encourage everyone to migrate to the "post Alonzo" format as support for the "legacy" output format might be removed in the future. Both formats can be mixed within a single transaction, both in outputs and in the collateral return output.
81+
A new, "post Alonzo", output format has been introduced in the Babbage ledger era which uses a map instead of an array to store the output data. For now, both the "legacy" (array) and "post Alonzo" (map) output formats are supported by HW wallets but we encourage everyone to migrate to the "post Alonzo" format as support for the "legacy" output format might be removed in the future. Both formats can be mixed within a single transaction, both in outputs and in the collateral return output.
7682

77-
_Legacy outputs_
83+
##### Legacy outputs
7884

7985
Outputs containing no multi-asset tokens must be serialized as a simple tuple, i.e. `[address, coin, ?datum_hash]` instead of `[address, [coin, {}], ?datum_hash]`.
8086

81-
_Post Alonzo outputs_
87+
##### Post Alonzo outputs
8288

8389
If the `data` of `datum_option` is included in an output, it must not be empty. `script_ref` (reference script) must also not be empty if it is included in an output.
8490

85-
**Multiassets**
91+
#### Multiassets
8692

8793
Since multiassets (`policy_id` and `asset_name`) are represented as maps, both need to be sorted in accordance with the specified canonical CBOR format. Also, an output or the mint field must not contain duplicate `policy_id`s and a policy must not contain duplicate `asset_name`s.
8894

89-
**Certificates**
95+
#### Certificates
9096

9197
Certificates of type `genesis_key_delegation` and `move_instantaneous_rewards_cert` are not supported and must not be included.
9298

@@ -107,7 +113,7 @@ Certificate stake credentials must be:
107113
- only script hashes in multi-sig transactions.
108114
(There is no restriction for transactions involving Plutus.)
109115

110-
**Withdrawals**
116+
#### Withdrawals
111117

112118
Since withdrawals are represented as a map of reward accounts, withdrawals also need to be sorted in accordance with the specified canonical CBOR format. A transaction must not contain duplicate withdrawals.
113119

@@ -116,7 +122,7 @@ Withdrawal reward accounts must be:
116122
- only based on script hashes in multi-sig transactions.
117123
(There is no restriction for transactions involving Plutus.)
118124

119-
**Auxiliary data**
125+
#### Auxiliary data
120126

121127
HW wallets do not serialize auxiliary data because of their complex structure. They only include the given auxiliary data hash in the transaction body. The only exception is Catalyst voting registration because it requires a signature computed by the HW wallet.
122128

@@ -128,7 +134,7 @@ In this exceptional case, auxiliary data must be encoded in their "tuple" format
128134

129135
The `auxiliary_scripts` must be an array of length 0.
130136

131-
## Reasoning
137+
## Rationale: how does this CIP achieve its goals?
132138

133139
### Canonical CBOR serialization format
134140

@@ -138,30 +144,38 @@ The specified canonical CBOR format is consistent with how certain other data ar
138144

139145
### Transaction body
140146

141-
**Multiassets**
147+
#### Multiassets
142148

143149
Allowing duplicate `policy_id`s (or `asset_name`s) might lead to inconsistencies between what is displayed to the user and how nodes and other tools might interpret the duplicate keys, i.e. all policies (or asset names) would be shown to the user, but nodes and other tools might eventually interpret only a single one of them.
144150

145-
**Certificates**
151+
#### Certificates
146152

147153
Combining withdrawals and pool registration certificates isn't allowed because both are signed by staking keys by pool owners. If it was allowed to have both in a transaction then the witness provided by a pool owner might inadvertently serve as a witness for a withdrawal for the owner's account.
148154

149-
**Withdrawals**
155+
#### Withdrawals
150156

151157
Similarly to multiassets, allowing duplicate withdrawals might lead to inconsistencies between what is displayed to the user and how nodes and other tools might interpret the duplicate keys.
152158

153-
**Auxiliary data**
159+
#### Auxiliary data
154160

155161
The specified auxiliary data format was chosen in order to be compatible with other Cardano tools, which mostly use this serialization format.
156162

157-
## Backwards compatibility
163+
### Backwards compatibility
158164

159165
Tools interacting with HW wallets might need to be updated in order to continue being compatible with HW wallets because of canonical CBOR serialization format, which is being enforced since multi-sig support.
160166

161-
## Tools
167+
## Path to Active
162168

163-
[`cardano-hw-interop-library`](https://github.com/vacuumlabs/cardano-hw-interop-lib) or [`cardano-hw-cli'](https://github.com/vacuumlabs/cardano-hw-cli) (which uses the interop library) can be used to validate or transform transactions into a HW wallet compatible format if possible.
169+
### Acceptance Criteria
170+
171+
- [x] Confirmation (by default if no ongoing incompatibilities) since Alonzo ledger era that this interoperability between software and hardware wallets has been generally achieved.
172+
173+
### Implementation Plan
174+
175+
- [x] Tools exist which can be used to validate or transform transactions into a HW wallet compatible format if possible:
176+
- [x] [`cardano-hw-interop-library`](https://github.com/vacuumlabs/cardano-hw-interop-lib)
177+
- [x] [`cardano-hw-cli'](https://github.com/vacuumlabs/cardano-hw-cli) (which uses the interop library)
164178

165179
## Copyright
166180

167-
This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode)
181+
This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode).

0 commit comments

Comments
 (0)