I’m excited to share hive-rs, a new Rust library for building on the Hive blockchain.
If you’ve used dhive in JavaScript, the goal here should feel familiar: a practical, typed client that makes common Hive workflows easier while staying close to real RPC behavior.
Rust has become my default for systems that need reliability, performance, and explicit error handling. Hive has a great ecosystem in JavaScript and Python, but I wanted a native Rust option that I could trust in production services.
Node.js is great because it's accessible, but if you want better performing and reliable apps that are always on (like apps that stream the Hive blockchain) you want a language like Rust which is honestly better suited to things like this than Node.js.
Surprisingly, there was no existing Hive client for Rust.
The goals for hive-rs were:
At a high level:
database, broadcast, blockchain, hivemind, rc, account_by_key, transaction_status)WIF, public key derivation, signing/verification)During launch testing against public nodes, a few compatibility edge cases showed up.
Instead of hiding them in app-level workarounds, I moved those fixes into the library:
AllNodesFailedAccountByKeyApi::get_key_references falls back to legacy condenser_api when appbase variants are unsupportedTransactionStatusApi::find_transaction falls back to condenser_api.get_transaction when transaction_status_api is unavailableBroadcastApi::send now attempts synchronous broadcast first, then falls back to async broadcast + confirmation lookup when neededThese changes were backed by new tests and full suite verification.
use hive_rs::{Asset, Client, PrivateKey, Result, TransferOperation};
#[tokio::main]
async fn main() -> Result<()> {
let client = Client::new_default();
let active_key = PrivateKey::from_wif("")?;
let confirmation = client
.broadcast
.transfer(
TransferOperation {
from: "alice".to_string(),
to: "bob".to_string(),
amount: Asset::from_string("0.001 HIVE")?,
memo: "hello from rust".to_string(),
},
&active_key,
)
.await?;
println!("tx id: {}", confirmation.id);
Ok(())
}
cargo add hive-rs
Short-term roadmap:
If you’re building on Hive with Rust, I’d love feedback:
Thanks for reading and for supporting open-source tooling in the Hive ecosystem.