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

Cardano: allow serialization using 258-tagged sets #1350

Merged
merged 1 commit into from
Dec 30, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately.
- Update manufacturer HID descriptor to bitbox.swiss
- Ethereum: remove deprecated Goerli network
- SD card: solve backup bug when sd card is re-inserted
- Cardano: allow serialization using 258-tagged sets

### 9.21.0
- Bitcoin: add support for sending to silent payment (BIP-352) addresses
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ endif()
#
# Versions MUST contain three parts and start with lowercase 'v'.
# Example 'v1.0.0'. They MUST not contain a pre-release label such as '-beta'.
set(FIRMWARE_VERSION "v9.21.0")
set(FIRMWARE_BTC_ONLY_VERSION "v9.21.0")
set(FIRMWARE_VERSION "v9.22.0")
set(FIRMWARE_BTC_ONLY_VERSION "v9.22.0")
set(BOOTLOADER_VERSION "v1.0.7")

find_package(PythonInterp 3.6 REQUIRED)
Expand Down
3 changes: 3 additions & 0 deletions messages/cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ message CardanoSignTransactionRequest {
repeated Withdrawal withdrawals = 7;
uint64 validity_interval_start = 8;
bool allow_zero_ttl = 9; // include ttl even if it is zero
// Tag arrays in the transaction serialization with the 258 tag.
// See https://github.com/IntersectMBO/cardano-ledger/blob/6e2d37cc0f47bd02e89b4ce9f78b59c35c958e96/eras/conway/impl/cddl-files/extra.cddl#L5
bool tag_cbor_sets = 10;
}

message CardanoSignTransactionResponse {
Expand Down
2 changes: 2 additions & 0 deletions py/bitbox02/bitbox02/bitbox02/bitbox02.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,8 @@ def cardano_address(self, address: cardano.CardanoAddressRequest) -> str:
def cardano_sign_transaction(
self, transaction: cardano.CardanoSignTransactionRequest
) -> cardano.CardanoSignTransactionResponse:
if transaction.tag_cbor_sets:
self._require_atleast(semver.VersionInfo(9, 22, 0))
request = cardano.CardanoRequest(sign_transaction=transaction)
return self._cardano_msg_query(
request, expected_response="sign_transaction"
Expand Down
60 changes: 30 additions & 30 deletions py/bitbox02/bitbox02/communication/generated/cardano_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion py/bitbox02/bitbox02/communication/generated/cardano_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ class CardanoSignTransactionRequest(google.protobuf.message.Message):
WITHDRAWALS_FIELD_NUMBER: builtins.int
VALIDITY_INTERVAL_START_FIELD_NUMBER: builtins.int
ALLOW_ZERO_TTL_FIELD_NUMBER: builtins.int
TAG_CBOR_SETS_FIELD_NUMBER: builtins.int
network: global___CardanoNetwork.ValueType
@property
def inputs(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___CardanoSignTransactionRequest.Input]: ...
Expand All @@ -297,6 +298,7 @@ class CardanoSignTransactionRequest(google.protobuf.message.Message):
allow_zero_ttl: builtins.bool
"""include ttl even if it is zero"""

tag_cbor_sets: builtins.bool
def __init__(self,
*,
network: global___CardanoNetwork.ValueType = ...,
Expand All @@ -308,8 +310,9 @@ class CardanoSignTransactionRequest(google.protobuf.message.Message):
withdrawals: typing.Optional[typing.Iterable[global___CardanoSignTransactionRequest.Withdrawal]] = ...,
validity_interval_start: builtins.int = ...,
allow_zero_ttl: builtins.bool = ...,
tag_cbor_sets: builtins.bool = ...,
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["allow_zero_ttl",b"allow_zero_ttl","certificates",b"certificates","fee",b"fee","inputs",b"inputs","network",b"network","outputs",b"outputs","ttl",b"ttl","validity_interval_start",b"validity_interval_start","withdrawals",b"withdrawals"]) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["allow_zero_ttl",b"allow_zero_ttl","certificates",b"certificates","fee",b"fee","inputs",b"inputs","network",b"network","outputs",b"outputs","tag_cbor_sets",b"tag_cbor_sets","ttl",b"ttl","validity_interval_start",b"validity_interval_start","withdrawals",b"withdrawals"]) -> None: ...
global___CardanoSignTransactionRequest = CardanoSignTransactionRequest

class CardanoSignTransactionResponse(google.protobuf.message.Message):
Expand Down
Loading