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

#46 in #key-pair

Download history 310/week @ 2024-06-21 194/week @ 2024-06-28 193/week @ 2024-07-05 337/week @ 2024-07-12 211/week @ 2024-07-19 446/week @ 2024-07-26 290/week @ 2024-08-02 176/week @ 2024-08-09 339/week @ 2024-08-16 375/week @ 2024-08-23 332/week @ 2024-08-30 315/week @ 2024-09-06 260/week @ 2024-09-13 279/week @ 2024-09-20 373/week @ 2024-09-27 390/week @ 2024-10-04

1,356 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

~10–28MB
~437K SLoC