What is Hiero?
Hiero provides access to the Hedera Hashgraph Network for the .NET platform. It manages the communication details with participating network nodes and provides an efficient set of asynchronous interface methods for consumption by .NET programs.
Hiero is built with .NET 10
How do I Install It?
Hiero is published in NuGet. You can install it with your favorite NuGet client, for example from the command line:
dotnet add package Hiero
The library references a minimum of dependencies. It relies on .NET's native gRPC libraries to access the Hedera network and utilizes the cryptographic services provided by the Bouncy Castle Project.
What does 'Hello World' for this Library Look like?
The most simple thing one can ask of the Hedera network is the balance of an account. Balances are read from a mirror node, which is free and needs no account of your own. Here is an example console program:
class Program
{
static async Task Main(string[] args)
{
// Usage: dotnet run -- https://testnet.mirrornode.hedera.com 0.0.98
var mirrorUrl = args[0];
if (!EntityId.TryParseShardRealmNum(args[1], out var queryAccount))
throw new ArgumentException($"Invalid query account: {args[1]}");
try
{
var mirror = new MirrorRestClient(new HttpClient { BaseAddress = new Uri(mirrorUrl) });
var balance = await mirror.GetAccountBalanceAsync(queryAccount);
Console.WriteLine(balance is null
? $"Account {queryAccount} was not found."
: $"Account Balance for {queryAccount} is {balance:#,#} tinybars.");
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
Console.Error.WriteLine(ex.StackTrace);
}
}
}
Hiero reads network state through the MirrorRestClient, which wraps an HttpClient pointed at a mirror node, and submits transactions and paid queries through the ConsensusClient, which orchestrates request construction and communication with the Hedera consensus nodes. A ConsensusClient requires a small amount of configuration: at a minimum an Endpoint, a ConsensusNodeEndpoint representing the internet network address and account of the node processing requests, plus a payer and signatory for anything that costs a fee. The EntityId identifies accounts, tokens, topics, and other entities using the standard shard.realm.num format (e.g. 0.0.98). Use EntityId.TryParseShardRealmNum to parse them from strings — this accepts the same format the Hedera portal gives you.
How do I learn more?
Tutorials: Step-by-step guides with code for every major workflow:
- Crypto Transactions
- Fungible Tokens
- Non-Fungible Tokens (NFTs)
- Consensus Service (HCS)
- Smart Contracts
- File Manipulation
- Scheduled Transactions
- Airdrops
- Mirror Node
- Miscellaneous
Developer Guides:
- Network Configuration — testnet vs mainnet, node rotation patterns
- Key Management — environment variables, vaults, async signing
- Dependency Injection — registering clients with IServiceCollection
- Error Handling — exception hierarchy, transient vs permanent codes, retry patterns
- Logging — gRPC-level diagnostics
API Documentation: Generated API reference with code examples for every type and method.
API Cookbook: Quick reference for all SDK operations in one flat list.
Is this project Open Source?
Yes, this is an open source project released under the Apache-2.0 License, the source code can be found at https://github.com/bugbytesinc/Hiero.