Latest 1.1.0
License MIT
Platforms ios 8.0, osx 10.10
Dependencies BigInt, MnemonicKit, Sodium

TezosKit     Build Status     codecov

TezosKit is a Swift library that is compatible with the Tezos Blockchain. TezosKit implements communication with the blockchain via the JSON API.

Donations help me find time to work on TezosKit. If you find the library useful, please consider donating to support ongoing develoment.

Currency Address
Tezos tz1SNXT8yZCwTss2YcoFi3qbXvTZiCojx833
Bitcoin 1CdPoF9cvw3YEiuRCHxdsGpvb5tSUYBBo
Bitcoin Cash qqpr9are9gzs5r0q7hy3gdehj3w074pyqsrhpdmxg6


TezosKit provides first class support for the following RPCs:

  • Getting account balances
  • Getting data about the chain head
  • Getting account delegates
  • Generating and restoring wallets
  • Sending transactions between accounts
  • Sending multiple operations in a single request
  • Setting / clearing delegates
  • Registering as a delegate
  • Originating accounts
  • Examining upgrade votes

The library is extensible allowing client code to easily create additional RPCs and signed operations, as required.

TesosKit takes care of complex block chain interactions for you:

  • Addresses are revealed automatically, if needed
  • Sending multiple operations by passing them in an array

TezosKit is heavily inspired by functionality provided by other Tezos SDKs, such as eztz or TezosJ.



TezosKit supports installation via CocoaPods. You can depened on TezosKit by adding the following to your Podfile:

pod "TezosKit"

LibSodium Errors

If you receive build errors about missing headers for Sodium, you need to install the LibSodium library.

The easiest way to do this is with Homebrew:

$ brew update && brew install libsodium

Getting Started

Create a Network Client

let publicNodeURL = URL(string: "")!
let tezosClient = TezosClient(remoteNodeURL: publicNodeURL)

Retrieve Data About the Blockchain

tezosClient.getHead() { (result: [String: Any]?, error: Error?) in
  guard let result = result,
        let metadata: = result["metadata"] as? [String : Any],
        let baker = metadata["baker"]  else {
  print("Baker of the block at the head of the chain is (baker)")

Retrieve Data About a Contract

let address = "KT1BVAXZQUc4BGo3WTJ7UML6diVaEbe4bLZA" //
tezosClient.getBalance(address: address) { (balance: TezosBalance?, error: Error?) in
  guard let balance = balance else {
  print("Balance of (address) is (balance.humanReadableRepresentation)")

Create a Wallet

let wallet = Wallet()
print("New wallet mnemonic is: (wallet.mnemonic)")

Send a Transaction

let wallet = Wallet()
let sendAmount = TezosBalance(balance: 1.0)!
let recipientAddress = ...
tezosClient.send(amount: sendAmount,
                 to recipientAddress: recipientAddress,
                 from address: wallet.address,
                 secretKey: wallet.secretKey) { (txHash, txError) in 
  print("Transaction sent. See:!)")

Send Multiple Transactions at Once

Here’s an example of how you can send multiple transactions at once. You
can easily send Jim and Bob some XTZ in one call:

let myWallet: Wallet = ...
let jimsAddress: String = tz1...
let bobsAddress: String = tz1...

let amountToSend = TezosBalance("2")!

let sendToJimOperation = TransactionOperation(amount: amountToSend,
                                              source: myWallet,
                                              destination: jimsAddress)
let sendToBobOperation = TransactionOperation(amount: amountToSend,
                                              source: myWallet,
                                              destination: bobsAddress)

let operations = [ sendToJimOperation, sendToBobOperation ]
tezosClient.forgeSignPreapplyAndInjectOperations(operations: operations,
                                                 source: myWallet.address,
                                                 keys: myWallet.keys) { (txHash, error) in
  print("Sent Jim and Bob some XTZ! See:!)")

Set a Delegate

let wallet = ...
let originatedAccountAddress = <Some Account Managed By Wallet>
let delegateAddress = ...
tezosClient.delegate(from: originatedAccountAddress,
                     to: delegateAddress,
                     keys: wallet.keys) { (txHash, txError) in 
  print("Delegate for (originatedAccountAddress) set to (delegateAddress).")


I am happy to accept pull requests.



Latest podspec

    "name": "TezosKit",
    "version": "1.1.0",
    "summary": "TezosKit provides a Swift based toolchain for interacting with the Tezos blockchain",
    "description": "TezosKit provides utilities for interacting with the Tezos Blockchain over an RPC API.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Keefer Taylor": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "source_files": [
    "exclude_files": "Sources/App/*.swift",
    "swift_version": "4.2",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10"
    "dependencies": {
        "BigInt": [
            "~> 3.1"
        "MnemonicKit": [],
        "Sodium": [
            "~> 0.7.0"
    "testspecs": [
            "name": "Tests",
            "test_type": "unit",
            "source_files": "TezosKitTests/*.swift"

Pin It on Pinterest

Share This