diff --git a/README.md b/README.md index 6848b92..fd01e04 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,8 @@ To install in development mode (editable) clone and run `pip3 install -e .` from PyPi installation includes prebuilt libraries for common platforms (win, macos, linux, raspi) - see [`src/embit/util/prebuilt/`](./src/embit/util/prebuilt/) folder. Library is built from [libsecp-zkp](https://github.com/ElementsProject/secp256k1-zkp) fork for Liquid support, but will work with pure [libsecp256k1](https://github.com/bitcoin-core/secp256k1) as well - just Liquid functionality doesn't work. If it fails to use the prebuilt or system library it will fallback to pure python implementation. -If you want to build the lib yourself, [clone it](https://github.com/ElementsProject/secp256k1-zkp) and build: - -```sh -git clone https://github.com/ElementsProject/secp256k1-zkp.git -cd secp256k1-zkp -git checkout f3708a1ecb445b1b05a0f8fcd1da6a88f83d89c4 -./autogen.sh -./configure --enable-module-ecdh --enable-module-musig --enable-module-recovery --enable-module-generator --enable-module-rangeproof --enable-module-schnorrsig --enable-module-surjectionproof --enable-experimental -make -sudo make install -``` +If you want to build the lib yourself, see: [Building secp256k1 for `embit`](/secp256k1/README.md). + ## Using non-English BIP39 wordlists [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md) defines wordlists for: @@ -74,3 +65,12 @@ mnemonic_to_seed(mnemonic, wordlist=spanish_wordlist) mnemonic_to_bytes(mnemonic, wordlist=spanish_wordlist) mnemonic_from_bytes(bytes_data, wordlist=spanish_wordlist) ``` + + +# Run the tests +Clone the repo and complete the development mode `pip3` installation step above. + +``` +cd tests +python3 run_tests.py +``` \ No newline at end of file diff --git a/secp256k1/README.md b/secp256k1/README.md index ae0d585..64f8601 100644 --- a/secp256k1/README.md +++ b/secp256k1/README.md @@ -1,24 +1,34 @@ -# Building secp256k1 for embit +# Building secp256k1 for `embit` +If you don't want to use a prebuilt binary packaged with `embit`, you can build it yourself. -If you don't want to use prebuilt binary packaged with `embit` you can build it yourself. -We are using **libsecp256k1** fork - -[**secp256k1-zkp**](https://github.com/ElementsProject/secp256k1-zkp). +## Clone `embit` recursively +We are using the **libsecp256k1** fork - [**secp256k1-zkp**](https://github.com/ElementsProject/secp256k1-zkp). + +Start by cloning `embit` with the `--recursive` flag: +```sh +git clone --recursive https://github.com/diybitcoinhardware/embit.git +``` + +This will automatically pull in the `libsecp256k1-zkp` repo and checkout the correct commit within that repo. -# Building the library under target platform -To build the library run: +## Building the library +This directory (`secp256k1/` in the `embit` root) already has a fully-configured Makefile to run the compilation for you. +On your target platform run: ```sh make ``` -To clean build directory use: +Copy the resulting binary from the `build/` subdir to `embit`'s `src/embit/util/prebuilt` directory. +To clean build directory use: ```shell make clean ``` + # Cross-compiling Windows DLL ## Toolchain install diff --git a/src/embit/util/prebuilt/libsecp256k1_darwin_arm64.dylib b/src/embit/util/prebuilt/libsecp256k1_darwin_arm64.dylib new file mode 100755 index 0000000..5c5726c Binary files /dev/null and b/src/embit/util/prebuilt/libsecp256k1_darwin_arm64.dylib differ