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

Pluggable ECC backends - Part 1 #24

Closed
pipermerriam opened this issue Jul 3, 2017 · 1 comment
Closed

Pluggable ECC backends - Part 1 #24

pipermerriam opened this issue Jul 3, 2017 · 1 comment

Comments

@pipermerriam
Copy link
Member

pipermerriam commented Jul 3, 2017

https://www.pivotaltracker.com/n/projects/2066033

What is wrong?

The library current uses a local python implementation of the necessary ECC functions for signature creation and verification. The library coincurve provides faster implementations of these functions but at the cost of requiring a system dependency.

  • Some users will value being able to do a vanilla install without futzing with system dependencies
  • Some users will value speed and be willing to install the necessary system dependencies to get it.

How can it be fixed?

Implement a pluggable backend system for all of the ECC functionality. This should start with a default backend which only delegates the current ECC functionality.

Implementation Details

  • Since we don't have a formal configuration spec for Py-EVM yet, lets use environment variables. for this one, lets use PYEVM_ECC_BACKEND
  • Copy the import_string function from populus: https://github.com/pipermerriam/populus/blob/master/populus/utils/module_loading.py
  • Implement a get_ecc_backend_class function which reads the PYEVM_ECC_BACKEND value from os.environ and imports the class.
  • Implement a get_ecc_backend function which returns the instantiated ECC backend class.
  • Implement a BaseECCBackend class which implements the base needed for ECC operations.
  • Implement a PurePythonECCBackend class which uses the functions found at evm.utils.ecdsa.
@DavidKnott
Copy link
Contributor

DavidKnott commented Jul 11, 2017

@pipermerriam I think I'll take a crack at this.

pacrob pushed a commit to pacrob/py-evm that referenced this issue Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants