#cross-chain #hash #vm #sig

renvm-sig

A library to construct mock RenVM signatures for cross-chain lock-and-mint operations

2 releases

0.1.1 Jun 10, 2021
0.1.0 May 18, 2021
Download history 18/week @ 2023-08-12 13/week @ 2023-08-19 10/week @ 2023-08-26 14/week @ 2023-09-02 20/week @ 2023-09-09 13/week @ 2023-09-16 9/week @ 2023-09-23 18/week @ 2023-09-30 16/week @ 2023-10-07 16/week @ 2023-10-14 18/week @ 2023-10-21 23/week @ 2023-10-28 22/week @ 2023-11-04 23/week @ 2023-11-11 17/week @ 2023-11-18 24/week @ 2023-11-25

90 downloads per month
Used in 3 crates

GPL-3.0 license

11KB
194 lines

RenVm Signatures

A library to construct mock RenVm signatures for cross-chain lock-and-mint operations.

Setup

$ cargo build

Usage

  • Random RenVm secret key and message
let renvm = RenVm::random();
let renvm_msg = RenVmMsgBuilder::default().build().unwrap();
let _renvm_sig = renvm.sign(&renvm_msg).unwrap();
  • RenVm secret key from bytes
let sk_bytes = [0u8; 32];
let _renvm = RenVm::from_bytes(&sk_bytes).unwrap();
  • RenVm secret key from hex string
let sk = "0x0000000000000000000000000000000000000000000000000000000000000000";
let _renvm = RenVm::from_str(sk).unwrap();
  • Builder pattern for RenVm message
// RenVm message structure
// | p_hash | amount | s_hash | to | n_hash |
// |   32   |   8    |   32   | 32 |   32   |
// random `to` and `n_hash`
let (p_hash, amount, s_hash) = ([0u8; 32], 0u64, [0u8; 32]);
let _renvm_msg = RenVmMsgBuilder::default()
  .p_hash(p_hash)
  .amount(amount)
  .s_hash(s_hash)
  .build()
  .unwrap();

Dependencies

~4.5MB
~75K SLoC