Skip to content

Instantly share code, notes, and snippets.

@fyookball
Last active May 7, 2019 20:13
Show Gist options
  • Select an option

  • Save fyookball/dbac6d1b0d3501964f8b868f2a48d279 to your computer and use it in GitHub Desktop.

Select an option

Save fyookball/dbac6d1b0d3501964f8b868f2a48d279 to your computer and use it in GitHub Desktop.
Adding Schnorr to Electron Cash

Thankfully, the hard work has been done by ABC and Calin Culianu, who ported the entire library into Electron Cash. Now the question is how to actually implement?

Adding Schnorr to Electron Cash

Currently, the sign() function in lib/transaction.py creates a signature using ECDSA-related objects like MySigningKey class from bitcoin.py, and sign_digest_deterministic, which I believe operates on a private key object returned from the ecdsa library.

Instead of this, the sign() function should directly call into secp256k1/src/modules/schnorr/secp256k1_schnorr_sign using the message and private key.

The has_secp variable should be already set from init and we can check that to handle errors based on the missing module. Although not sure if something special is required for wrong versions of libsec (linux users).

This is envisioned as an optional setting (to use Schnorr instead of ECDSA) either on the send tab or in the preferences.

@fyookball
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment