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: ledger blind signing #259

Merged
merged 17 commits into from
Dec 2, 2023
Merged

feat: ledger blind signing #259

merged 17 commits into from
Dec 2, 2023

Conversation

dj8yfo
Copy link
Collaborator

@dj8yfo dj8yfo commented Nov 16, 2023

resolves #33
tmp
verify:
tmp

tx link exactly from flow on screens above

@dj8yfo dj8yfo force-pushed the blind_signing branch 2 times, most recently from cc7265d to 099900b Compare November 17, 2023 11:32
@frol
Copy link
Collaborator

frol commented Nov 24, 2023

@dj8yfo Is there a chance to improve the error message for old Ledger App?

telegram-cloud-photo-size-2-5404517375199530626-y

src/common.rs Outdated Show resolved Hide resolved
src/common.rs Outdated Show resolved Hide resolved
src/transaction_signature_options/sign_with_ledger/mod.rs Outdated Show resolved Hide resolved
@dj8yfo dj8yfo marked this pull request as draft November 24, 2023 18:15
Copy link
Collaborator

@frol frol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is great and the only missing bit is the release of near-ledger-rs crate, so we don't depend on git version. I have left my comments on the PR to near-ledger-rs, and once those addressed we will be able to release it and unblock this PR.

@dj8yfo dj8yfo marked this pull request as ready for review November 28, 2023 11:36
@dj8yfo dj8yfo marked this pull request as draft November 28, 2023 14:06
@dj8yfo dj8yfo marked this pull request as ready for review November 29, 2023 17:14
@dj8yfo dj8yfo requested a review from frol December 1, 2023 20:35
@frol frol enabled auto-merge (squash) December 2, 2023 09:05
@frol frol merged commit cc411f5 into near:master Dec 2, 2023
14 checks passed
@frol frol mentioned this pull request Dec 2, 2023
@dj8yfo dj8yfo mentioned this pull request Mar 4, 2024
13 tasks
frol pushed a commit that referenced this pull request Mar 14, 2024
- [x] check out and build old version of near-cli-rs
([revision](https://github.com/near/near-cli-rs/tree/0f484b5053f12f3baba66cda5a82252bee916913)
before [blind signature
pull](#259) )
  - [x] near 0.7.2
- [x] test a normal tx on `app-near`: ok
https://explorer.near.org/transactions/HSE5jFuKvrDYeaxEqd445PwVsahcYgXV6kZQQY5uDsj2
    - [x] test a long tx  on `app-near`: error 
        ```bash
        `near` CLI has a new update available 0.7.2 →  0.8.1
        To update `near` CLI use: near extensions self-update
        Error:
0: Error occurred while signing the transaction:
APDUExchangeError("Unknown Ledger APDU retcode: 27024")

        ❯ pcalc 27024
27024 0x6990 0y110100110010000

        ❯ rg 0x6990
        workdir/app-near/src/constants.h
        37:#define SW_BUFFER_OVERFLOW 0x6990
        ```
- [x] test a long tx on `app-near-rs`: ok
https://nearblocks.io/txns/5yzwbUckGSWMyYj8hbG3jJjHWLef5atkzc2fiVrf8Loy
- [x] current pr near 0.8.1
- [x] test a normal tx on `app-near`: ok
https://nearblocks.io/txns/5Ptbx3iGykXKQpxYBhR9YUa5BCmS6jGjyLiE7oGYGXKN
  - [x] test a long tx on `app-near` : error
      ```bash
      Error:
0: Error occurred while signing the transaction:
APDUExchangeError("Ledger APDU retcode: 0x6990")
      ```
- [x] test a long tx on `app-near-rs`: ok
https://nearblocks.io/txns/2duat1ripdAxtHJjuNyNT7ZNd6adADs8LGMZ6VsV9FDm
  - [x] test a deploy contract tx 
- [x] on `app-near-rs`: ok
https://nearblocks.io/txns/GV6Y9TcTMhqBUoYL6M6BxkeCXXkEe8TfmLJCVx64U7ME#
      ```bash
      Unsigned transaction:
signer_id:
1b11b3b31673033936ad07bddc01f9da27d974811e480fb197c799e23480a489
receiver_id:
1b11b3b31673033936ad07bddc01f9da27d974811e480fb197c799e23480a489
      actions:
         -- deploy contract DC1KnvBEyPhBzBxCBarMgY9ZN68krg449Dk8AxARU2QN
      ...
      ```
- [x]
https://nearblocks.io/address/1b11b3b31673033936ad07bddc01f9da27d974811e480fb197c799e23480a489#contract
    - [x] on `app-near`: error, same behaviour as long tx  (12288 bytes)
      ```bytes
      12288   ./examples/adder/res/adder.wasm
      ```
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.

Signing a transaction with Ledger fails if the transaction is "too" big
2 participants