Skip to content

Commit 7d0994c

Browse files
committed
Support Ledger clear signing
1 parent c65eaf6 commit 7d0994c

File tree

11 files changed

+688
-113
lines changed

11 files changed

+688
-113
lines changed

.github/workflows/checks.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Checks
33
env:
44
CAIRO_LANG_VERSION: "0.13.1"
55
DEVNET_VERSION: "0.1.2"
6-
DEVNET_SHA: 7e7dbb5
7-
LEDGER_APP_SHA: dd58c5c
8-
LEDGER_APP_DEV_TOOLS_SHA: a037d42181f4bed9694246256e2c9e2a899e775c302a9c6482c81f87c28e1432
6+
DEVNET_SHA: fc5a2753a2eedcc27eed7a4fae3ecac08c2ca1b4 # v0.3.0
7+
LEDGER_APP_SHA: 768a7b47b0da681b28112342edd76e2c9b292c4e # v2.3.1
8+
LEDGER_APP_DEV_TOOLS_SHA: a845b2ab0b5dd824133f73858f6f373edea85ec1bd828245bf50ce9700f33bcb # v4.5.0
99

1010
on:
1111
push:
@@ -197,6 +197,7 @@ jobs:
197197
run: |
198198
cd /apps/app-starknet
199199
git checkout ${{ env.LEDGER_APP_SHA }}
200+
cd starknet
200201
cargo clean
201202
cargo ledger build nanox
202203
@@ -216,6 +217,9 @@ jobs:
216217
- name: Wait for Speculos to start
217218
run: sleep 5
218219

220+
- name: Allow blind signing
221+
run: ./starknet_py/tests/unit/signer/allow_ledger_blind_signing.sh
222+
219223
- name: Update automation rules
220224
working-directory: starknet_py/tests/unit/signer
221225
run: |

docs/api/signer.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,11 @@ To use LedgerSigner, you need to install starknetpy with `ledger` extra like thi
4747
.. autoclass:: LedgerSigner
4848
:members:
4949
:member-order: groupwise
50+
51+
-----------------
52+
LedgerSigningMode
53+
-----------------
54+
55+
.. autoclass:: LedgerSigningMode
56+
:members:
57+
:member-order: groupwise

docs/guide/signing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ signing algorithm, it is possible to create ``Account`` with custom
1515
Signing with Ledger
1616
-------------------
1717
:ref:`LedgerSigner` allows you to sign transactions using a Ledger device. The device must be unlocked and Starknet app needs to be open.
18-
Currently used version of Starknet app is ``1.1.1`` and only blind-signing is possible. Clear-signing will be available in the near future.
18+
Currently used version of `Starknet app <https://github.com/LedgerHQ/app-starknet>`_ is ``2.3.1``.
1919

2020
.. codesnippet:: ../../starknet_py/tests/unit/signer/test_ledger_signer.py
2121
:language: python

docs/migration_guide.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Migration guide
22
===============
33

4+
******************************
5+
0.25.1 Migration guide
6+
******************************
7+
8+
.. py:currentmodule:: starknet_py.net.signer.ledger_signer
9+
10+
1. Support for clear signing with :class:`LedgerSigner` has been added. It's now the default signing mode (see :class:`LedgerSigningMode`).
11+
412
******************************
513
0.25.0 Migration guide
614
******************************

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ docs = [
3131
]
3232
ledger = [
3333
"ledgerwallet>=0.5.0,<1.0.0",
34-
"bip-utils>=2.9.3,<3.0.0",
3534
]
3635

3736
[project.urls]

starknet_py/constants.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939

4040
ROOT_PATH = Path(__file__).parent
4141

42-
# Ledger constants
43-
STARKNET_CLA = 0x5A
44-
EIP_2645_PURPOSE = 0x80000A55
45-
EIP_2645_PATH_LENGTH = 6
46-
PUBLIC_KEY_RESPONSE_LENGTH = 65
47-
SIGNATURE_RESPONSE_LENGTH = 65
48-
VERSION_RESPONSE_LENGTH = 3
49-
5042
# Result of `encode_shortstring("ANY_CALLER")`
5143
ANY_CALLER = 0x414E595F43414C4C4552
5244

@@ -55,3 +47,8 @@
5547
class OutsideExecutionInterfaceID(IntEnum):
5648
V1 = 0x68CFD18B92D1907B8BA3CC324900277F5A3622099431EA85DD8089255E4181
5749
V2 = 0x1D1144BB2138366FF28D8E9AB57456B1D332AC42196230C3A602003C89872
50+
51+
52+
ARGENT_V040_CLASS_HASH = (
53+
0x036078334509B514626504EDC9FB252328D1A240E4E948BEF8D0C08DFF45927F
54+
)

0 commit comments

Comments
 (0)