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

libsecp256k1 binary for M1 Macs (darwin_arm64) #29

Merged
merged 1 commit into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
```
24 changes: 17 additions & 7 deletions secp256k1/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file not shown.