A feature-complete Bitcoin SV SDK for Elixir providing primitives, script, transactions, wallet, tokens, and SPV.
The BSV SDK for Elixir offers a full set of Bitcoin SV primitives, script interpreter, transaction builder, wallet utilities, token support, and SPV features. It is a pure Elixir library using OTP crypto modules and follows the {:ok, result} | {:error, reason} convention.
Earn XP for sharing
Sign in to get a personal referral link and earn XP every time someone visits through your link.
go-bt
The go-to Bitcoin Transaction library for BSV
No reviews yet — be the first.
Sign in to get a referral link and earn XP for every visitor
```elixir
# Generate a key pair
key = BSV.PrivateKey.generate()
pubkey = BSV.PrivateKey.to_public_key(key)
address = BSV.PublicKey.to_address(pubkey)
# Build a transaction
alias BSV.Transaction.{Builder, P2PKH}
tx = Builder.new()
|> Builder.add_input(txid, vout, satoshis, locking_script, P2PKH.unlock(key))
|> Builder.add_p2pkh_output(recipient_address, amount)
|> Builder.sign()
# Broadcast via ARC
client = BSV.ARC.Client.new(%BSV.ARC.Config{api_key: "your-key"})
{:ok, response} = BSV.ARC.Client.broadcast(client, tx)
# BRC-78 encrypted message
{:ok, ciphertext} = BSV.Message.Encrypted.encrypt(plaintext, sender_key, recipient_pubkey)
{:ok, plaintext} = BSV.Message.Encrypted.decrypt(ciphertext, recipient_key, sender_pubkey)
# STAS token issuance
alias BSV.Tokens.Factory.Stas
{:ok, tx} = Stas.build_issue_tx(config)
```