Hex.pm Docs License: MIT

A native Elixir SDK for the Hedera network — keys, identifiers, protoc-generated protobuf, gRPC, and the Consensus, Crypto, Token (incl. NFTs), File, Schedule and Smart Contract services. No NIFs for the core crypto; no Java/Python bridge.

Installation

Add hedera_ex to your deps in mix.exs:

def deps do
  [{:hedera_ex, "~> 0.2.0"}]
end

Status: alpha — but it talks to the network. The crypto/encoding foundation is unit-tested offline, and building, signing and submitting transactions has been validated against the live Hedera testnet (the node accepts the natively-signed transactions and returns SUCCESS receipts). APIs may still change.

It exists because the Elixir ecosystem has no maintained Hedera SDK — projects that need on-chain anchoring from the BEAM currently shell out to the Python/Java SDKs. This library brings the hard parts (Hedera's exact signing conventions and protobuf/gRPC wire format) into pure, tested Elixir.

What works today

AreaModule(s)Notes
Keccak-256Hedera.Crypto.KeccakPure Elixir; the Ethereum/Hedera padding (not SHA3). Matches known vectors.
Ed25519 keysHedera.PrivateKey, Hedera.PublicKeyGenerate, sign, verify, hex round-trip.
ECDSA secp256k1 keyssameHedera convention: Keccak-256 prehash, canonical low-S 64-byte r‖s, 33-byte compressed public key.
IdentifiersHedera.AccountId, Hedera.TopicId, Hedera.Timestamp, Hedera.TransactionId, Hedera.DurationParse / format / protobuf-encode.
ProtobufHedera.ProtoMinimal proto3 wire encoder + decoder.
Wire encodingHedera.Pb.* (protoc-generated)Hedera.Transaction builds every body as a generated struct; priv/protos + generate.sh.
TransactionsHedera.TransactionBuild + sign TransactionBodySignedTransactionTransaction. Multi-signature via :signers.
Consensus Servicesubmit_message/3, create_topic/2Create topics, submit messages (HCS). Verified live.
Crypto Servicetransfer_hbar/3HBAR transfers (sint64/ZigZag; must net to zero). Verified live.
Token Service (HTS)create_token/2, mint_token/4, burn_token/4, associate_token/4, transfer_token/4, transfer_nft/4, freeze_token/unfreeze_token, grant_kyc/revoke_kyc, wipe_token, pause_token/unpause_tokenFungible and NFT create / mint (metadata) / transfer, plus freeze / KYC / wipe / pause management. Full lifecycle verified live.
File Servicecreate_file/2, append_file/4, update_file/3, delete_file/2Verified live.
Schedule Servicecreate_schedule/2, sign_schedule/3Scheduled transfers + multi-sig collection. Verified live.
Smart Contract Servicecreate_contract/2, call_contract/3Deploy (inline bytecode or file) + call. Verified live.
gRPCHedera.Grpc, Hedera.Client, Hedera.NetworkUnary calls over HTTP/2 (h2c); multi-node address book + cross-node retry.
Receiptstransaction_receipt/3, Hedera.ReceiptPoll getTransactionReceipts → status, topic seq / hash, token / file / schedule / contract id, new total supply, NFT serials. Verified live.
Mirror nodeHedera.MirrorNodeREST reads (topic messages, transactions).
alias Hedera.{AccountId, Client, PrivateKey, TopicId}

client =
  Client.testnet(
    AccountId.parse("0.0.8260469"),
    PrivateKey.from_string_ecdsa(System.fetch_env!("OPERATOR_KEY"))
  )

{:ok, %{precheck_code: 0, ok?: true}} =
  Client.submit_message(client, TopicId.parse("0.0.9339331"), "audit-event-hash")

Run the live test yourself:

OPERATOR_ID=0.0.x OPERATOR_KEY=0x... mix test --include network

Roadmap

  • [x] Keccak-256, Ed25519 + ECDSA secp256k1 (Hedera conventions), identifiers, protobuf primitives
  • [x] TransactionBody + SignedTransaction + Transaction encoding (HCS create / submit)
  • [x] gRPC client over HTTP/2 (submitMessage, createTopic) — validated live on testnet
  • [x] Receipt queries (status + sequence number) via gRPC getTransactionReceipts — verified live
  • [x] Mirror-node REST helpers (Hedera.MirrorNode)
  • [x] node address book + cross-node retry on transient (BUSY) failures
  • [ ] Token Service (HTS), account create/transfer, crypto transfer
  • [ ] protoc-generated message modules from the canonical Hedera .proto files
  • [ ] hex.pm release

Why field numbers aren't guessed

The transaction layer encodes Hedera protobuf messages whose field numbers must match the canonical schema exactly. Rather than ship unverified guesses, that layer lands together with the gRPC path so it can be validated end-to-end against a real testnet node.

Tests

mix test          # offline; deterministic, no network

License

MIT — see LICENSE.