rustao β Rust SDK for AO
rustao is an asynchronous Rust library for interacting with the AO protocol on Arweave. It provides a clean, ergonomic API to send messages, spawn processes, perform dry runs, query compute endpoints, and handle hybrid encryption β matching the functionality of the official goao SDK.
π Features
- β
Async/Await β Built on
tokiofor high performance. - π¨ Send Messages β Sign and send messages to AO processes.
- π± Spawn Processes β Deploy new processes from module transactions.
- π§ͺ Dry Runs β Simulate message execution without committing.
- π Compute Queries β Fetch process state via HTTP compute endpoints.
- π Wait for Results β Poll until a message result is available.
- π Hybrid Encryption β RSAβOAEP + AESβGCM for secure payloads.
- π§Ύ Arweave Wallet Support β Sign using JWK files.
- π Local Crypto β Embedded RSA signing (from arweave-rust) for security.
π¦ Installation
Add this to your Cargo.toml:
[]
= { = "../rustao" }
= { = "1", = ["full"] }
= "1.0"
ποΈ Modules
rustao::crypto
Local RSA cryptographic operations (cloned from arweave-rust for security):
Driver::generate_key()β Generate new RSA-PSS key pairPrivateKey::sign(data)β Sign data with RSA-PSSPrivateKey::verify(data, signature)β Verify signature
rustao::core
Core Arweave types:
TransactionDataβ Transaction data structure
rustao::Client
Main client for interacting with AO:
send_message()β Send messages to processesspawn_process()β Spawn new processesdry_run()β Simulate executionget_compute_json()β Query process state
rustao::ARSigner
Wallet signing:
ARSigner::from_file(path)β Load from JWK filesign(data)β Sign dataaddress()β Get wallet address
π Quick Start
use ;
async
π§ͺ Testing
Run all tests:
Run live network tests:
π± Example Dapp
See /home/tony/rustao-example for a complete Dapp that fetches dApps from AoStore:
Then visit http://localhost:8080
π§βπ» Contributing
Contributions are welcome! Please open an issue or pull request.
License
MIT License. See the LICENSE file for details.
π Acknowledgements
- Built on top of arweave-rust for cryptographic operations
- Inspired by goao