| Crates.io | foxchain-id |
| lib.rs | foxchain-id |
| version | 0.1.0 |
| created_at | 2025-11-29 13:36:00.871948+00 |
| updated_at | 2025-12-04 21:05:19.11648+00 |
| description | Multi-chain blockchain address identification library |
| homepage | https://github.com/librehunt/foxchain-id |
| repository | https://github.com/librehunt/foxchain-id |
| max_upload_size | |
| id | 1956711 |
| size | 488,724 |
Multi-chain blockchain address identification library for Rust.
foxchain-id provides functionality to identify which blockchain(s) an input string (address, public key, or private key) belongs to. It supports multiple blockchain address formats and returns normalized addresses with confidence scores for candidate chains.
use foxchain_id::identify;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Identify an EVM address
let result = identify("0xd8da6bf26964af9d7eed9e03e53415d37aa96045")?;
println!("Normalized address: {}", result[0].normalized);
for candidate in result {
println!("Chain: {}, Confidence: {:.2}", candidate.chain, candidate.confidence);
println!("Reasoning: {}", candidate.reasoning);
}
Ok(())
}
EVM Addresses (Ethereum, Polygon, BSC, Avalanche, Arbitrum, Optimism, Base, Fantom, Celo, Gnosis)
0x followed by 40 hex charactersBitcoin Ecosystem (Bitcoin, Litecoin, Dogecoin)
1)3)bc1/ltc1/etc.)Solana Addresses
Tron Addresses
Cosmos Ecosystem Addresses (Cosmos Hub, Osmosis, Juno, Akash, Stargaze, Secret Network, Terra, Kava, Regen, Sentinel)
Substrate/Polkadot Ecosystem Addresses (Polkadot, Kusama, Generic Substrate)
Cardano Addresses
Public Key Detection and Address Derivation
See Format Documentation for detailed information about each format.
use foxchain_id::identify;
let result = identify("0x742d35Cc6634C0532925a3b844Bc454e4438f44e")?;
// Get normalized address
let normalized = result[0].normalized;
// Get all candidate chains
for candidate in result {
if candidate.confidence > 0.9 {
println!("High confidence match: {}", candidate.chain);
}
}
use foxchain_id::identify;
let result = identify("0xd8da6bf26964af9d7eed9e03e53415d37aa96045")?;
// Find specific chain
if let Some(ethereum) = result.iter().find(|c| c.chain == "ethereum") {
println!("Ethereum confidence: {}", ethereum.confidence);
}
// Get highest confidence candidate
let best_match = result.iter()
.max_by(|a, b| a.confidence.partial_cmp(&b.confidence).unwrap());
Contributions are welcome! Please see the main project repository for contribution guidelines.
This project is licensed under the GPL-3.0 license.