LedgerHQ / app-near

Ledger repo for Near app
MIT License
11 stars 9 forks source link

Bling Signing Implementation #13

Open ClockRide opened 2 years ago

ClockRide commented 2 years ago

Hey. Is it possible to implement a blind sign feature in the future, or some technical limitations are preventing doing this? It would be highly convenient to deploy a smart contract, for instance.

dj8yfo commented 11 months ago

planning to work on this (in the nearest future)

dj8yfo commented 11 months ago

building app locally (not within docker) with prepare-devenv.sh against https://github.com/LedgerHQ/nanos-secure-sdk/archive/v2.1.0-2.tar.gz SDK required changing gcc-arm-embedded/5.0 -> gcc-arm-embedded/10.3-2021.10 and clang+llvm-4.0.0 -> clang+llvm-9.0.0 with following diff:

diff --git a/workdir/app-near/Makefile b/workdir/app-near/Makefile
index fc6ebf1..cb24670 100755
--- a/workdir/app-near/Makefile
+++ b/workdir/app-near/Makefile
@@ -103,21 +103,21 @@ ifneq ($(DEBUG),0)
 else
         DEFINES   += PRINTF\(...\)=
 endif

 ##############
 #  Compiler  #
 ##############
 ifneq ($(BOLOS_ENV),)
 $(info BOLOS_ENV=$(BOLOS_ENV))
 CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/
-GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/
+GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-10.3-2021.10/bin/
 else
 $(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH)
 endif
 ifeq ($(CLANGPATH),)
 $(info CLANGPATH is not set: clang will be used from PATH)
 endif
 ifeq ($(GCCPATH),)
 $(info GCCPATH is not set: arm-none-eabi-* will be used from PATH)
 endif

diff --git a/workdir/app-near/prepare-devenv.sh b/workdir/app-near/prepare-devenv.sh
index 6e8fe7e..17cc9c6 100755
--- a/workdir/app-near/prepare-devenv.sh
+++ b/workdir/app-near/prepare-devenv.sh
@@ -25,42 +25,48 @@ if [[ $(cat /etc/udev/rules.d/20-hw1.rules) == *'ATTRS{idVendor}=="2c97", ATTRS{
 fi

 if [ ! -d dev-env ]; then
     mkdir dev-env
     mkdir dev-env/SDK
     mkdir dev-env/CC
     mkdir dev-env/CC/others
     mkdir dev-env/CC/nanox

-    wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q1-update/+download/gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2
-    tar xf gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2
-    rm gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2
-    cp -r gcc-arm-none-eabi-5_3-2016q1 dev-env/CC/nanox/gcc-arm-none-eabi-5_3-2016q1
-    mv gcc-arm-none-eabi-5_3-2016q1 dev-env/CC/others/gcc-arm-none-eabi-5_3-2016q1
+    # wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q1-update/+download/gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2
+    wget 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2?rev=78196d3461ba4c9089a67b5f33edf82a&hash=5631ACEF1F8F237389F14B41566964EC' -O gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
+    # tar xf gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2
+    tar xf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
+    # rm gcc-arm-none-eabi-5_3-2016q1-20160330-linux.tar.bz2
+    rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
+    # cp -r gcc-arm-none-eabi-5_3-2016q1 dev-env/CC/nanox/gcc-arm-none-eabi-5_3-2016q1
+    cp -r gcc-arm-none-eabi-10.3-2021.10 dev-env/CC/nanox/gcc-arm-none-eabi-10.3-2021.10
+    mv gcc-arm-none-eabi-10.3-2021.10 dev-env/CC/others/gcc-arm-none-eabi-10.3-2021.10
+
+    # wget http://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.10.tar.xz -O clang+llvm.tar.xz
+    wget https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -O clang+llvm.tar.xz

-    wget http://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.10.tar.xz -O clang+llvm.tar.xz
     tar xf clang+llvm.tar.xz
     rm clang+llvm.tar.xz
     mv clang+llvm* dev-env/CC/others/clang-arm-fropi

     wget http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -O clang+llvm.tar.xz
     tar xf clang+llvm.tar.xz
     rm clang+llvm.tar.xz
     mv clang+llvm* dev-env/CC/nanox/clang-arm-fropi

     wget https://github.com/LedgerHQ/blue-secure-sdk/archive/blue-r21.1.tar.gz -O blue-secure-sdk.tar.gz
     tar xf blue-secure-sdk.tar.gz
     rm blue-secure-sdk.tar.gz
     mv blue-secure-sdk* dev-env/SDK/blue-secure-sdk

-    wget https://github.com/LedgerHQ/nanos-secure-sdk/archive/nanos-160.tar.gz -O nanos-secure-sdk.tar.gz
+    wget https://github.com/LedgerHQ/nanos-secure-sdk/archive/v2.1.0-2.tar.gz -O nanos-secure-sdk.tar.gz
     tar xf nanos-secure-sdk.tar.gz
     rm nanos-secure-sdk.tar.gz
     mv nanos-secure-sdk* dev-env/SDK/nanos-secure-sdk

     python3 -m venv dev-env/ledger_py3
     source dev-env/ledger_py3/bin/activate
     pip install wheel
     pip install ledgerblue
 fi

as mentioned in this issue

dj8yfo commented 11 months ago

similar problem was encountered during dockerized build, created a #29

dj8yfo commented 10 months ago

opened LedgerHQ/speculos#431

dj8yfo commented 10 months ago

opened khorolets/near-ledger-rs#3

dj8yfo commented 10 months ago

opened khorolets/near-ledger-rs#4

dj8yfo commented 10 months ago

opened #31 NOTE: this was noticed to be redundant, as https://github.com/LedgerHQ/app-near/pull/34/files#diff-a95cdfb0638115d118bf02cea4e270325849640839dc17c4bf63ebd9da23ee50R58-R61 can be used instead, should the need arise

dj8yfo commented 9 months ago

opened https://github.com/near/near-cli-rs/pull/259

dj8yfo commented 9 months ago

opened #33

dj8yfo commented 9 months ago

opened #35