Github messages for voidlinux
 help / color / mirror / Atom feed
From: ar-jan <ar-jan@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Switch to bitcoin-core libsecp256k1 and remove libbitcoin; update electrum, Electron-Cash
Date: Sun, 21 May 2023 15:31:37 +0200	[thread overview]
Message-ID: <20230521133137.IdU4At1yw7KYnRv4JHQeoQQj6dhiVPPZn1yF88ZdIW4@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43702@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2749 bytes --]

There is an updated pull request by ar-jan against master on the void-packages repository

https://github.com/ar-jan/void-packages bitcoin-etc
https://github.com/void-linux/void-packages/pull/43702

Switch to bitcoin-core libsecp256k1 and remove libbitcoin; update electrum, Electron-Cash
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### New package: libsecp256k1
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**

Electrum v4.4.1 moved to using libsecp256k1 0.3.1 (`libsecp256k1.so.2`).

Void's current libsecp256k1 is from https://github.com/libbitcoin/secp256k1, which is extremely outdated.
I believe this was originally used because back then https://github.com/bitcoin-core/secp256k1 was too unstable and did not provide tagged releases. Now they do, so we should move to that.

The only two packages which use libsecp256k1 are `electrum` and `Electron-Cash` (besides the other `libbitcoin-*` packages).

Electron Cash can also use bitcoin-core's libsecp256k1 v0.3.1, although it actually needs https://github.com/Bitcoin-ABC/secp256k1 or Electron Cash's own fork for full functionality (CashFusion would not work):
> you CAN use the Core version, and it will speed-up ECDSA sigs.. but then for Schnorr sigs it won't speed them up at all since Core's Schnorr stuff differs from Bitcoin Cash's. So Electron Cash will detect that it's on Core, and will fall-back to using python-only Schnorr in that case (slow).
> https://github.com/Electron-Cash/Electron-Cash/issues/2596#issuecomment-1529926625

I assume CashFusion is currently not working either since it's already using the wrong version of the library, so switching to bitcoin-core's libsecp256k1 v0.3.1 should be fine for Electron Cash too.

That leaves the other 10 libbitcoin packages which also depend on libsecp256k1:

- libbitcoin-blockchain
- libbitcoin-client
- libbitcoin-consensus
- libbitcoin-database
- libbitcoin-explorer
- libbitcoin-network
- libbitcoin-node
- libbitcoin-protocol
- libbitcoin-server
- libbitcoin-system

These packages haven't been updated for Void Linux since August 2019, so it seems safe to assume they're not actively used. There are no other packages that depend on any of them. I propose we remove them.

If agreed that we can remove the `libbitcoin`  packages, is it OK to just provide the new .so version from the new package, and remove the old one when updating `removed-packages`? 

> libsecp256k1.so.2 libsecp256k1-0.3.1_1
> libsecp256k1.so.0 libbitcoin-secp256k1-0.1.0.13_1

A patch file from https://github.com/void-linux/void-packages/pull/43702.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-bitcoin-etc-43702.patch --]
[-- Type: text/x-diff, Size: 9375 bytes --]

From efad733e40679c124e989bde3ad539abdae4aac5 Mon Sep 17 00:00:00 2001
From: Arjan Mossel <arjanmossel@gmail.com>
Date: Thu, 4 May 2023 19:02:21 +0200
Subject: [PATCH 1/4] libbitcoin-secp256k1: remove package.

An updated version of the libsecp256k1 library is provided via
new libsecp256k1 package (bitcoin-core version).
---
 common/shlibs                         |  1 -
 srcpkgs/libbitcoin-secp256k1-devel    |  1 -
 srcpkgs/libbitcoin-secp256k1/template | 35 ---------------------------
 srcpkgs/removed-packages/template     |  1 +
 4 files changed, 1 insertion(+), 37 deletions(-)
 delete mode 120000 srcpkgs/libbitcoin-secp256k1-devel
 delete mode 100644 srcpkgs/libbitcoin-secp256k1/template

diff --git a/common/shlibs b/common/shlibs
index de1171416591..91abc90b0176 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3667,7 +3667,6 @@ libdwarves_emit.so.1 pahole-1.12_1
 libdwarves_reorganize.so.1 pahole-1.12_1
 libclthreads.so.2 clthreads-2.4.2_1
 libclxclient.so.3 clxclient-3.9.2_1
-libsecp256k1.so.0 libbitcoin-secp256k1-0.1.0.13_1
 libltc.so.11 libltc-1.3.1_1
 libvpd-2.2.so.2 libvpd-2.2.6_1
 libvpd_cxx-2.2.so.2 libvpd-2.2.6_1
diff --git a/srcpkgs/libbitcoin-secp256k1-devel b/srcpkgs/libbitcoin-secp256k1-devel
deleted file mode 120000
index 527eb8d59d7e..000000000000
--- a/srcpkgs/libbitcoin-secp256k1-devel
+++ /dev/null
@@ -1 +0,0 @@
-libbitcoin-secp256k1
\ No newline at end of file
diff --git a/srcpkgs/libbitcoin-secp256k1/template b/srcpkgs/libbitcoin-secp256k1/template
deleted file mode 100644
index 42f5ad1ded0e..000000000000
--- a/srcpkgs/libbitcoin-secp256k1/template
+++ /dev/null
@@ -1,35 +0,0 @@
-# Template file for 'libbitcoin-secp256k1'
-pkgname=libbitcoin-secp256k1
-version=0.1.0.13
-revision=1
-build_style=gnu-configure
-configure_args="--disable-benchmark --disable-coverage --disable-jni
- --disable-openssl-tests --enable-exhaustive-tests --enable-module-recovery
- --enable-tests --with-gnu-ld"
-hostmakedepends="autoconf automake libtool m4 pkg-config"
-short_desc="Optimized C library for EC operations on curve secp256k1"
-maintainer="Andy Weidenbaum <atweiden@tutanota.de>"
-license="MIT"
-homepage="https://github.com/libbitcoin/secp256k1"
-distfiles="https://github.com/libbitcoin/secp256k1/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz"
-checksum=9e48dbc88d0fb5646d40ea12df9375c577f0e77525e49833fb744d3c2a69e727
-
-pre_configure() {
-	./autogen.sh
-}
-
-post_install() {
-	vlicense COPYING
-	vdoc README.md
-}
-
-libbitcoin-secp256k1-devel_package() {
-	short_desc+=" - development files"
-	depends="${sourcepkg}>=${version}_${revision}"
-	pkg_install() {
-		vmove usr/include
-		vmove "usr/lib/*.a"
-		vmove "usr/lib/*.so"
-		vmove usr/lib/pkgconfig
-	}
-}
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index 9b0ce9c93fce..b7d177441873 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -291,6 +291,7 @@ replaces="
  libbitcoin-system-devel<=3.6.0_10
  libco-devel<=20_1
  libco<=20_1
+ libbitcoin-secp256k1<=0.1.0.13_1
  libechonest-qt5<=2.3.1_2
  libechonest-qt5-devel<=2.3.1_2
  libdbusmenu-qt<=0.9.2_4

From 53be6138f9601da30f93f57dc0c7260b3bd208e1 Mon Sep 17 00:00:00 2001
From: Arjan Mossel <arjanmossel@gmail.com>
Date: Mon, 1 May 2023 17:55:47 +0200
Subject: [PATCH 2/4] New package: libsecp256k1-0.3.2

---
 common/shlibs                 |  1 +
 srcpkgs/libbitcoin-secp256k1  |  1 +
 srcpkgs/libsecp256k1-devel    |  1 +
 srcpkgs/libsecp256k1/template | 41 +++++++++++++++++++++++++++++++++++
 4 files changed, 44 insertions(+)
 create mode 120000 srcpkgs/libbitcoin-secp256k1
 create mode 120000 srcpkgs/libsecp256k1-devel
 create mode 100644 srcpkgs/libsecp256k1/template

diff --git a/common/shlibs b/common/shlibs
index 91abc90b0176..21a8315431aa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3667,6 +3667,7 @@ libdwarves_emit.so.1 pahole-1.12_1
 libdwarves_reorganize.so.1 pahole-1.12_1
 libclthreads.so.2 clthreads-2.4.2_1
 libclxclient.so.3 clxclient-3.9.2_1
+libsecp256k1.so.2 libsecp256k1-0.3.2_1
 libltc.so.11 libltc-1.3.1_1
 libvpd-2.2.so.2 libvpd-2.2.6_1
 libvpd_cxx-2.2.so.2 libvpd-2.2.6_1
diff --git a/srcpkgs/libbitcoin-secp256k1 b/srcpkgs/libbitcoin-secp256k1
new file mode 120000
index 000000000000..1a5b8eebddec
--- /dev/null
+++ b/srcpkgs/libbitcoin-secp256k1
@@ -0,0 +1 @@
+libsecp256k1
\ No newline at end of file
diff --git a/srcpkgs/libsecp256k1-devel b/srcpkgs/libsecp256k1-devel
new file mode 120000
index 000000000000..1a5b8eebddec
--- /dev/null
+++ b/srcpkgs/libsecp256k1-devel
@@ -0,0 +1 @@
+libsecp256k1
\ No newline at end of file
diff --git a/srcpkgs/libsecp256k1/template b/srcpkgs/libsecp256k1/template
new file mode 100644
index 000000000000..0d0ad3245359
--- /dev/null
+++ b/srcpkgs/libsecp256k1/template
@@ -0,0 +1,41 @@
+# Template file for 'libsecp256k1'
+pkgname=libsecp256k1
+version=0.3.2
+revision=1
+build_style=gnu-configure
+configure_args="--disable-benchmark --disable-coverage --enable-experimental
+ --enable-module-ecdh --enable-module-recovery --enable-tests
+ --enable-exhaustive-tests --with-gnu-ld"
+hostmakedepends="autoconf automake libtool m4 pkg-config"
+short_desc="Optimized C library for EC operations on curve secp256k1"
+maintainer="Arjan Mossel <arjanmossel@gmail.com>"
+license="MIT"
+homepage="https://github.com/bitcoin-core/secp256k1"
+distfiles="https://github.com/bitcoin-core/secp256k1/archive/v${version}.tar.gz"
+checksum="ef2e1061951b8cf94a7597b4e60fd7810613e327e25305e8d73dfdff67d12190"
+
+pre_configure() {
+	./autogen.sh
+}
+
+post_install() {
+	vlicense COPYING
+	vdoc README.md
+}
+
+libsecp256k1-devel_package() {
+	short_desc+=" - development files"
+	depends="${sourcepkg}>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include
+		vmove "usr/lib/*.a"
+		vmove "usr/lib/*.so"
+		vmove usr/lib/pkgconfig
+	}
+}
+
+libbitcoin-secp256k1_package() {
+	depends="libsecp256k1"
+	short_desc+=" - transitional dummy package"
+	build_style=meta
+}

From 223cbe10042cdd4ef369efa8bcd2134eab7ccc48 Mon Sep 17 00:00:00 2001
From: Arjan Mossel <arjanmossel@gmail.com>
Date: Mon, 1 May 2023 16:13:03 +0200
Subject: [PATCH 3/4] electrum: update to 4.4.3; use bitcoin-core libsecp256k1

---
 srcpkgs/electrum/template | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/electrum/template b/srcpkgs/electrum/template
index dcabed755423..448b299bc2f4 100644
--- a/srcpkgs/electrum/template
+++ b/srcpkgs/electrum/template
@@ -1,14 +1,14 @@
 # Template file for 'electrum'
 pkgname=electrum
-version=4.2.0
-revision=3
+version=4.4.3
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-PyQt5-devel-tools"
 depends="python3-aiohttp python3-aiohttp_socks python3-aiorpcx
  python3-bitstring python3-dnspython python3-ecdsa python3-jsonrpclib
  python3-protobuf python3-pyaes python3-pycryptodomex python3-PyQt5
- python3-qrcode python3-socks python3-cryptography libbitcoin-secp256k1
- python3-certifi"
+ python3-qrcode python3-socks python3-cryptography libsecp256k1
+ python3-certifi libzbar"
 # Optional dependencies:
 #  btchip - BTChip hardware wallet support
 #  trezor - TREZOR hardware wallet support
@@ -19,8 +19,9 @@ short_desc="Lightweight Bitcoin wallet"
 maintainer="Charles E. Lehner <cel@celehner.com>"
 license="MIT"
 homepage="https://electrum.org/"
+changelog="https://raw.githubusercontent.com/spesmilo/electrum/master/RELEASE-NOTES"
 distfiles="https://github.com/spesmilo/electrum/archive/${version}.tar.gz"
-checksum=3a24c7ed7a2bb47888f308380b8624a3fff3cf3882fd63d904cd9c3ec543fb3b
+checksum=223baa42e2d276dcb3784e34d6558b2efd8a06b761be27447e7eca24ab4e55d6
 
 post_install() {
 	vsed -i -e 's|electrum %u|electrum|' \

From 911691731082e94af547862a9329cb61397eb714 Mon Sep 17 00:00:00 2001
From: Arjan Mossel <arjanmossel@gmail.com>
Date: Mon, 1 May 2023 19:29:16 +0200
Subject: [PATCH 4/4] Electron-Cash: update to 4.3.1; use bitcoin-core
 libsecp256k1

---
 srcpkgs/Electron-Cash/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/Electron-Cash/template b/srcpkgs/Electron-Cash/template
index 38ca3449b093..a4fbc06791e1 100644
--- a/srcpkgs/Electron-Cash/template
+++ b/srcpkgs/Electron-Cash/template
@@ -1,20 +1,20 @@
 # Template file for 'Electron-Cash'
 pkgname=Electron-Cash
-version=4.2.10
-revision=3
+version=4.3.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools python3-PyQt5-devel-tools"
 depends="python3-PyQt5 python3-PyQt5-svg python3-qrcode python3-dateutil
  python3-jsonrpclib python3-protobuf
  python3-dnspython python3-requests python3-pysocks python3-stem
- python3-ecdsa python3-pyaes python3-pycryptodomex libbitcoin-secp256k1 libzbar
+ python3-ecdsa python3-pyaes python3-pycryptodomex libsecp256k1 libzbar
  python3-cryptography>=2.6 python3-pathvalidate python3-psutil"
 short_desc="Lightweight Bitcoin Cash client"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT"
 homepage="https://electroncash.org"
 distfiles="https://github.com/Electron-Cash/Electron-Cash/releases/download/${version}/Electron-Cash-${version}.tar.gz"
-checksum=2c77258c0e8ccdc42d16cd9bdbc26b47f94b92d9ba8a86d63c25a17ec832b324
+checksum=8297c687fe3d081de7fbbf874c04a35c3d86f81aa90ad13c2852647a3daa2e87
 make_check=no # Depends on unpackaged SimpleWebSocketServer
 
 post_install() {

  parent reply	other threads:[~2023-05-21 13:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-01 17:40 [PR PATCH] Switch to bitcoin-core/libsecp256k1 and remove libbitcoin? Update " ar-jan
2023-05-01 17:44 ` ar-jan
2023-05-01 18:53 ` ar-jan
2023-05-02  1:28 ` atweiden
2023-05-06 12:41 ` [PR PATCH] [Updated] " ar-jan
2023-05-06 12:54 ` ar-jan
2023-05-15 20:32 ` [PR PATCH] [Updated] Switch to bitcoin-core libsecp256k1 and remove libbitcoin; update " ar-jan
2023-05-15 20:56 ` ar-jan
2023-05-15 21:05 ` ar-jan
2023-05-16 18:14 ` [PR PATCH] [Updated] " ar-jan
2023-05-16 19:06 ` ar-jan
2023-05-21 13:31 ` ar-jan [this message]
2023-05-21 13:35 ` ar-jan
2023-06-26 20:07 ` [PR PATCH] [Closed]: " leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230521133137.IdU4At1yw7KYnRv4JHQeoQQj6dhiVPPZn1yF88ZdIW4@z \
    --to=ar-jan@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).