loopring_sign
loopring_sign is a Rust-based tool designed to generate EdDSA signatures for interacting with the Loopring API. It complements the official Python reference implementation, which is available in the Loopring repository under the loopring-v3 branch at hello_loopring/sdk/ethsnarks.
This tool utilizes the Poseidon hash function and the Baby Jubjub Elliptic Curve (specified in EIP-2494) to produce EdDSA signatures compatible with the Loopring protocol.
:warning: Development Status & Security Note
:construction: Under Active Development: This crate is currently under active development. As such, it may contain bugs or incomplete features. Use it at your own risk.
:lock: Security Warning: This crate requires the use of your private key. Ensure you understand the risks involved and never share your private key with untrusted parties.
Install
Add this to your Cargo.toml
loopring_sign = "0.1.4"
Example 1: Generate EdDSA Signature
use generate_eddsa_signature;
Example 2: Calculate L2 Private Key
use generate_l2_keys;
License
This project is licensed under
Acknowledgements
Special thanks to leppaludi and fudgey. Their implementations in Go and C# have provided additional perspectives and have been a source of inspiration for loopring_sign. Check out their repositories for Go and C# implementations:
- Go implementation: go-loopring-sig
- C# implementation: PoseidonSharp