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

[Rust]: Implement Private and Public keys #3093

Closed
6 tasks done
satoshiotomakan opened this issue Apr 17, 2023 · 0 comments · Fixed by #3107 or #3120
Closed
6 tasks done

[Rust]: Implement Private and Public keys #3093

satoshiotomakan opened this issue Apr 17, 2023 · 0 comments · Fixed by #3107 or #3120
Assignees
Labels
enhancement New feature or request

Comments

@satoshiotomakan
Copy link
Collaborator

satoshiotomakan commented Apr 17, 2023

Is your feature request related to a problem? Please describe.

Transaction signing is the key responsibility of wallet-core. We need to implement the PrivateKey and PublicKey structures to be able to move one of the blockchains from C++ to Rust.

The Private and Public keys implementation is the next step in moving ETH blockchain to Rust.

Describe the solution you'd like

Add and implement PrivateKey and PublicKey structures in Rust.
The list of elliptic curves need to be supported:

  • secp256k1 (in particular, used in ETH blockchain)
  • nist256p1
  • ed25519 and its modifications:
    • ed25519-blake2b-nano
    • curve25519 (in particular, used in Waves blockchain)
    • ed25519-cardano-seed (used in Cardano blockchain)
  • Starkex curve (used in Starknet blockchain)

Checklist

  • Explore the Rust crates that provides the secp256k1 implementation.
  • Explore the Rust crates that provides the nist256p1 implementation.
  • Explore the Rust crates that provides the ed25519 implementation.
  • Implement PrivateKey and PublicKey high-level structures in Rust
  • Export TWPrivateKey and TWPublicKey FFI types
  • Add multiple unit and integration tests (Rust->C++, Rust)

Resources

Crates that can help to achieve the signing:

  • crypto
  • rust-secp256k1 - a wrapper around a C-library
  • libsecp256k1 - secp256k1 implementation in pure Rust
  • curve25519-dalek - a library providing group operations on the Edwards and Montgomery forms of Curve25519, and on the prime-order Ristretto group.
@satoshiotomakan satoshiotomakan added the enhancement New feature or request label Apr 17, 2023
@satoshiotomakan satoshiotomakan self-assigned this Apr 17, 2023
@satoshiotomakan satoshiotomakan linked a pull request Apr 21, 2023 that will close this issue
9 tasks
@satoshiotomakan satoshiotomakan linked a pull request Apr 26, 2023 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants
@satoshiotomakan and others