Skip to content

Commit 82fe0a6

Browse files
authored
Merge pull request #13 from miketlk/merge-develop-into-release
Merge master key fingerprint syscall and remove Nano S support.
2 parents 42357cc + 8dfa951 commit 82fe0a6

File tree

56 files changed

+415
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+415
-209
lines changed

.github/workflows/build_and_functional_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ jobs:
3434
with:
3535
download_app_binaries_artifact: "compiled_app_binaries"
3636
test_dir: "tests_liquid"
37+
run_for_devices: '["nanosp","nanox"]'

.github/workflows/ci-workflow.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ on:
1717

1818
jobs:
1919
job_build:
20-
name: Compilation for NanoS, X, and S+
20+
name: Compilation for Nano X, and S+
2121

2222
strategy:
2323
matrix:
2424
include:
25-
- model: nanos
26-
SDK: "$NANOS_SDK"
2725
- model: nanox
2826
SDK: "$NANOX_SDK"
2927
- model: nanosp
@@ -115,7 +113,6 @@ jobs:
115113
strategy:
116114
matrix:
117115
include:
118-
- model: nanos
119116
- model: nanox
120117
- model: nanosp
121118

@@ -139,16 +136,15 @@ jobs:
139136
140137
- name: Run tests
141138
run: |
142-
cd tests_liquid_main
143139
pip install --prefer-binary -r requirements.txt
140+
cd tests_liquid_main
144141
PYTHONPATH=$PYTHONPATH:/speculos pytest --tb=short -v --device=${{matrix.model}} --speculos_api_port 5000
145142
146143
job_test_testnet:
147144
name: Tests on testnet
148145
strategy:
149146
matrix:
150147
include:
151-
- model: nanos
152148
- model: nanox
153149
- model: nanosp
154150

@@ -172,8 +168,8 @@ jobs:
172168
173169
- name: Run tests
174170
run: |
175-
cd tests_liquid_testnet
176171
pip install --prefer-binary -r requirements.txt
172+
cd tests_liquid_testnet
177173
PYTHONPATH=$PYTHONPATH:/speculos pytest --tb=short -v --device=${{matrix.model}} --speculos_api_port 5000
178174
179175
job_test_python_lib_legacyapp:
@@ -199,9 +195,9 @@ jobs:
199195

200196
- name: Run tests
201197
run: |
198+
pip install --prefer-binary -r requirements.txt
202199
cd bitcoin_client/tests
203-
pip install -r requirements.txt
204-
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --timeout=300 --model=nanos
200+
PYTHONPATH=$PYTHONPATH:/speculos pytest --headless --timeout=300 --model=nanosp
205201
206202
job_test_js_lib:
207203
if: false

.github/workflows/codeql-workflow.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,14 @@ jobs:
2828
language: [ 'cpp' ]
2929
runs-on: ubuntu-latest
3030
container:
31-
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest
32-
permissions:
33-
actions: read
34-
contents: read
35-
security-events: write
31+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
3632

3733
steps:
3834
- name: Clone
3935
uses: actions/checkout@v4
4036

4137
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
38+
uses: github/codeql-action/init@v3
4339
with:
4440
languages: ${{ matrix.language }}
4541
queries: security-and-quality
@@ -49,5 +45,5 @@ jobs:
4945
make BOLOS_SDK=${{ matrix.SDK }}
5046
5147
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@v2
48+
uses: github/codeql-action/analyze@v3
5349

Makefile

Lines changed: 54 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,9 @@ ifeq ($(BOLOS_SDK),)
2727
$(error Environment variable BOLOS_SDK is not set)
2828
endif
2929

30-
include $(BOLOS_SDK)/Makefile.defines
31-
32-
# TODO: Compile with the right path restrictions
33-
#
34-
# The right path restriction would be something like
35-
# --path "*'/0'"
36-
# for mainnet, and
37-
# --path "*'/1'"
38-
# for testnet.
39-
#
40-
# That is, restrict the BIP-44 coin_type, but not the purpose.
41-
# However, such wildcards are not currently supported by the OS.
42-
#
43-
# Note that the app still requires explicit user approval before exporting
44-
# any xpub outside of a small set of allowed standard paths.
45-
4630
# Application allowed derivation curves.
4731
CURVE_APP_LOAD_PARAMS = secp256k1
4832

49-
# Application allowed derivation paths.
50-
#
51-
# If there would be a dedicated SDK function returning master key
52-
# fingerprint without the need to derive the root pubkey, the proper path
53-
# configuration should be:
54-
#
55-
# PATH_APP_LOAD_PARAMS = "44'/1'" "48'/1'" "49'/1'" "84'/1'" "86'/1'"
56-
#
57-
PATH_APP_LOAD_PARAMS = ""
58-
5933
# Allowed SLIP21 paths
6034
PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy"
6135

@@ -83,65 +57,70 @@ VARIANT_VALUES = liquid_regtest liquid_testnet liquid
8357
########################################
8458
# Application custom permissions #
8559
########################################
86-
HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1
8760
HAVE_APPLICATION_FLAG_GLOBAL_PIN = 1
8861
HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1
8962

9063
ifeq ($(COIN),liquid_regtest)
91-
92-
# Liquid regtest
93-
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
94-
DEFINES += BIP32_PRIVKEY_VERSION=0x04358394
95-
DEFINES += BIP44_COIN_TYPE=1
96-
DEFINES += COIN_P2PKH_VERSION=111
97-
DEFINES += COIN_P2SH_VERSION=75
98-
DEFINES += COIN_PREFIX_CONFIDENTIAL=4
99-
DEFINES += HAVE_LIQUID
100-
DEFINES += LIQUID_NET_REGTEST
101-
DEFINES += COIN_COINID_SHORT=\"tLBTC\"
102-
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"ert\"
103-
DEFINES += COIN_NATIVE_SEGWIT_PREFIX_CONFIDENTIAL=\"el\"
104-
105-
APPNAME = "Liquid Regtest"
64+
# Application allowed derivation paths (Liquid testnet/regtest).
65+
PATH_APP_LOAD_PARAMS = "*/1'" # purpose=* / coin_type=Testnet(1)
66+
67+
# Liquid regtest
68+
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
69+
DEFINES += BIP32_PRIVKEY_VERSION=0x04358394
70+
DEFINES += BIP44_COIN_TYPE=1
71+
DEFINES += COIN_P2PKH_VERSION=111
72+
DEFINES += COIN_P2SH_VERSION=75
73+
DEFINES += COIN_PREFIX_CONFIDENTIAL=4
74+
DEFINES += HAVE_LIQUID
75+
DEFINES += LIQUID_NET_REGTEST
76+
DEFINES += COIN_COINID_SHORT=\"tLBTC\"
77+
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"ert\"
78+
DEFINES += COIN_NATIVE_SEGWIT_PREFIX_CONFIDENTIAL=\"el\"
79+
80+
APPNAME = "Liquid Regtest"
10681

10782
else ifeq ($(COIN),liquid_testnet)
108-
109-
# Liquid testnet
110-
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
111-
DEFINES += BIP32_PRIVKEY_VERSION=0x04358394
112-
DEFINES += BIP44_COIN_TYPE=1
113-
DEFINES += COIN_P2PKH_VERSION=36
114-
DEFINES += COIN_P2SH_VERSION=19
115-
DEFINES += COIN_PREFIX_CONFIDENTIAL=23
116-
DEFINES += HAVE_LIQUID
117-
DEFINES += LIQUID_NET_TESTNET
118-
DEFINES += COIN_COINID_SHORT=\"tLBTC\"
119-
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"tex\"
120-
DEFINES += COIN_NATIVE_SEGWIT_PREFIX_CONFIDENTIAL=\"tlq\"
121-
122-
APPNAME = "Liquid Testnet"
83+
# Application allowed derivation paths (Liquid testnet/regtest).
84+
PATH_APP_LOAD_PARAMS = "*/1'" # purpose=* / coin_type=Testnet(1)
85+
86+
# Liquid testnet
87+
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
88+
DEFINES += BIP32_PRIVKEY_VERSION=0x04358394
89+
DEFINES += BIP44_COIN_TYPE=1
90+
DEFINES += COIN_P2PKH_VERSION=36
91+
DEFINES += COIN_P2SH_VERSION=19
92+
DEFINES += COIN_PREFIX_CONFIDENTIAL=23
93+
DEFINES += HAVE_LIQUID
94+
DEFINES += LIQUID_NET_TESTNET
95+
DEFINES += COIN_COINID_SHORT=\"tLBTC\"
96+
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"tex\"
97+
DEFINES += COIN_NATIVE_SEGWIT_PREFIX_CONFIDENTIAL=\"tlq\"
98+
99+
APPNAME = "Liquid Testnet"
123100

124101
else ifeq ($(COIN),liquid)
125-
126-
# Liquid
127-
DEFINES += BIP32_PUBKEY_VERSION=0x0488B21E
128-
DEFINES += BIP32_PRIVKEY_VERSION=0x0488ADE4
129-
DEFINES += BIP44_COIN_TYPE=1776
130-
DEFINES += COIN_P2PKH_VERSION=57
131-
DEFINES += COIN_P2SH_VERSION=39
132-
DEFINES += COIN_PREFIX_CONFIDENTIAL=12
133-
DEFINES += HAVE_LIQUID
134-
DEFINES += LIQUID_NET_MAINNET
135-
DEFINES += COIN_COINID_SHORT=\"LBTC\"
136-
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"ex\"
137-
DEFINES += COIN_NATIVE_SEGWIT_PREFIX_CONFIDENTIAL=\"lq\"
138-
139-
APPNAME = "Liquid"
102+
# Application allowed derivation paths (Liquid main network, liquidv1).
103+
PATH_APP_LOAD_PARAMS = "*/1776'" # purpose=* / coin_type=Liquid(1776)
104+
105+
# Liquid
106+
DEFINES += BIP32_PUBKEY_VERSION=0x0488B21E
107+
DEFINES += BIP32_PRIVKEY_VERSION=0x0488ADE4
108+
DEFINES += BIP44_COIN_TYPE=1776
109+
DEFINES += COIN_P2PKH_VERSION=57
110+
DEFINES += COIN_P2SH_VERSION=39
111+
DEFINES += COIN_PREFIX_CONFIDENTIAL=12
112+
DEFINES += HAVE_LIQUID
113+
DEFINES += LIQUID_NET_MAINNET
114+
DEFINES += COIN_COINID_SHORT=\"LBTC\"
115+
DEFINES += COIN_NATIVE_SEGWIT_PREFIX=\"ex\"
116+
DEFINES += COIN_NATIVE_SEGWIT_PREFIX_CONFIDENTIAL=\"lq\"
117+
118+
APPNAME = "Liquid"
140119

141120
else
142-
ifeq ($(filter clean,$(MAKECMDGOALS)),)
143-
$(error Unsupported COIN - use liquid_regtest, liquid_testnet, liquid)
144-
endif
121+
ifeq ($(filter clean,$(MAKECMDGOALS)),)
122+
$(error Unsupported COIN - use liquid_regtest, liquid_testnet, liquid)
123+
endif
145124
endif
146125

147126
ifneq (,$(findstring liquid,$(COIN)))

ledger_app.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[app]
22
build_directory = "./"
33
sdk = "C"
4-
devices = ["nanos", "nanox", "nanos+"]
4+
devices = ["nanox", "nanos+"]
55

66
[tests]
77
unit_directory = "./unit-tests/"

0 commit comments

Comments
 (0)