signet-rs
Minimal,
no_stdtransaction builders for Bitcoin and EVM networks, ready for contracts, embedded clients, and signing services.
Crates.io • Documentation • Testing Guide
Documentation
- API reference: https://docs.rs/signet-rs
- Build locally:
cargo doc --all-features --no-deps --open - Doc notes: see
docs/README.md
Installation
[]
= "0.0.2"
Features
- ✅ EVM transaction builder with native EIP-1559 encoding and flexible access-list support.
- ✅ Bitcoin transaction builder with legacy + SegWit signing payloads, PSBT helpers, and DER utilities.
- ✅
no_stdby default with opt-instdfeature for integrations such asschemars.
Quick Start
EVM transaction
use parse_eth_address;
use ;
let to_address_str = "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
let to_address = parse_eth_address;
let max_gas_fee: u128 = 20_000_000_000;
let max_priority_fee_per_gas: u128 = 1_000_000_000;
let gas_limit: u128 = 21_000;
let chain_id: u64 = 1;
let nonce: u64 = 0;
let data: = vec!;
let value: u128 = 10_000_000_000_000_000; // 0.01 ETH
let evm_tx =
.nonce
.to
.value
.input
.max_priority_fee_per_gas
.max_fee_per_gas
.gas_limit
.chain_id
.build;
let rlp_encoded = evm_tx.build_for_signing;
Bitcoin transaction
use ;
use ;
let txid_str = "2ece6cd71fee90ff613cee8f30a52c3ecc58685acf9b817b9c467b7ff199871c";
let hash = from_hex.unwrap;
let txid = Txid;
let vout = 0;
let txin: TxIn = TxIn ;
let sender_script_pubkey_hex = "76a914cb8a3018cf279311b148cb8d13728bd8cbe95bda88ac";
let sender_script_pubkey = ScriptBuf;
let receiver_script_pubkey_hex = "76a914406cf8a18b97a230d15ed82f0d251560a05bda0688ac";
let receiver_script_pubkey = ScriptBuf;
let spend_txout: TxOut = TxOut ;
let change_txout = TxOut ;
let bitcoin_tx =
.version
.inputs
.outputs
.lock_time
.build;
let encoded_tx = bitcoin_tx.build_for_signing_legacy;
Testing
See TESTING.md for the unit, integration, and feature-flag test matrix plus the exact cargo commands we run in CI.
License
Licensed under the Apache License 2.0. Portions derive from omni-transaction-rs by NEAR Protocol and contributors.
Copyright 2024 Proximity Labs Limited