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: integration of new bitbox API #1415

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

shonsirsha
Copy link
Contributor

Addresses issue: #1406

@refi93
Copy link
Collaborator

refi93 commented Jun 25, 2024

Thanks @shonsirsha, we will look into that

btw, I got a question for bitbox02 devs, if you are in touch with them - will bitbox firmware support vote delegation certificates? Shortly (not sure when exactly, no exact times available, AFAIK) after the upcoming hardfork, in order to be able to withdraw rewards, wallets will need to delegate their vote at least to an "always abstrain" DRep - more info here:

https://github.com/cardano-foundation/CIPs/tree/master/CIP-1694#incentives-for-ada-holders-to-delegate-voting-stake
https://docs.intersectmbo.org/cardano/cardano-upgrades/hard-forks/chang-timeline-and-dependencies

Relevant fields in the transaction body:
https://github.com/IntersectMBO/cardano-ledger/blob/cf05d70ea4e8eae4ce2ad349ed17850c0c8204d1/eras/conway/test-suite/cddl-files/conway.cddl#L277
https://github.com/IntersectMBO/cardano-ledger/blob/cf05d70ea4e8eae4ce2ad349ed17850c0c8204d1/eras/conway/test-suite/cddl-files/conway.cddl#L303

We didn't update Adalite yet, but will do so in the upcoming weeks

@benma
Copy link
Contributor

benma commented Jun 25, 2024

Hi @refi93, BitBox firmware dev here. If it is required to withdraw staking funds, we will support it. Any suggestions for how to test such a change before it is live?

Would you potentially be interested in helping us to add support in the BitBox02 firmware? It could be more efficient as you will be more familiar with the details. There is a simulator for easy testing.

Protobuf certificate definitions:

https://github.com/BitBoxSwiss/bitbox02-firmware/blob/6446fcf2016fbb4a38384a677fe1aa7c08560195/messages/cardano.proto#L89

Certificate verification code:

https://github.com/BitBoxSwiss/bitbox02-firmware/blob/6446fcf2016fbb4a38384a677fe1aa7c08560195/src/rust/bitbox02-rust/src/hww/api/cardano/sign_transaction/certificates.rs#L31

called from the main transaction verification/processing function:

https://github.com/BitBoxSwiss/bitbox02-firmware/blob/6446fcf2016fbb4a38384a677fe1aa7c08560195/src/rust/bitbox02-rust/src/hww/api/cardano/sign_transaction.rs#L172

@refi93
Copy link
Collaborator

refi93 commented Jun 25, 2024

@benma For the sake of inspiration/test vectors I'd recommend checking the ledger JS library integration tests which include also transactions with vote delegations and other new kinds of certificates: https://github.com/vacuumlabs/ledgerjs-cardano-shelley/blob/9c643c406ed200e44b56e8349ec2ac3c53b670de/test/integration/__fixtures__/signTx.ts#L758

here's Ledger's cardano app source code: https://github.com/LedgerHQ/app-cardano/blob/605d7095d9d40cc04b18cb398a163d50e0215afd/src/signTx.c#L1101

additionally, here's trezor firmware PR adding conway functionality: https://github.com/trezor/trezor-firmware/pull/3496/files

regarding possible assistance with development, we'll discuss internally and get back to you in the upcoming 1-2 days 👍

@refi93 refi93 merged commit cf5d86a into vacuumlabs:develop Jul 12, 2024
2 of 5 checks passed
refi93 added a commit that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants