21 releases

0.8.4 Mar 26, 2024
0.8.3 Oct 16, 2023
0.8.0 Aug 5, 2023
0.7.3 Jul 13, 2023
0.6.1 Dec 28, 2022

#54 in #key-pair

Download history 84/week @ 2024-01-02 65/week @ 2024-01-09 94/week @ 2024-01-16 75/week @ 2024-01-23 162/week @ 2024-01-30 133/week @ 2024-02-06 108/week @ 2024-02-13 182/week @ 2024-02-20 216/week @ 2024-02-27 147/week @ 2024-03-05 165/week @ 2024-03-12 121/week @ 2024-03-19 174/week @ 2024-03-26 157/week @ 2024-04-02 141/week @ 2024-04-09 88/week @ 2024-04-16

570 downloads per month
Used in angry-purple-tiger

Apache-2.0

140KB
3.5K SLoC

Continuous Integration codecov

helium-crypto-rs

This library implements various cryptographic functions used by Helium Blockchain. This includes creating keypairs for supported key types signing messages and verifying messages with public keys. Public keys support binary and B58 encode/decoding as used by the Helium blockchain.

See the library documentation for usage details.

Using

Add a dependency to your projects Cargo.toml:

helium-crypto = "<version>"

lib.rs:

Crypto primitives used by various Helium blockchain and wallet services.

The library exposes Elliptic Curve (ECC) NIST P-256 (secp256r1), Certicom's SECG SEC2 K-256 (secp256k1), and ED25519 keypairs based on the excellent work done by the RustCrypto and Dalek cryptography projects.

The secp256r1 public keys currently representable on the Helium blockchain are only those that satisfy the "ECC Compact" strategy described in a Victor Miller paper, which compresses keys to just their X-coordinate. For this reason, such keys are called "ecc_compact" rather than "secp256r1".

The intended implemenation strategy in this crate allows for keypair implementations where the private key is based external to the software, such as an ECC608 chip or an HSM.

Dependencies

~9–29MB
~448K SLoC