Hyperledger Sawtooth SDK
Hyperledger Sawtooth is an enterprise solution for building, deploying, and running distributed ledgers (also called blockchains). It provides an extremely modular and flexible platform for implementing transaction-based updates to shared state between untrusted parties coordinated by consensus algorithms.
The Sawtooth Swift SDK provides a number of useful components that simplify developing Swift applications which interface with the Sawtooth platform.
The Swift SDK's SawtoothSigning module can be imported to a Cocoa/Cocoa Touch project via Carthage, a dependency manager for Cocoa applications.
Install Carthage using these installation instructions.
Create a Cartfile in the same directory where your
In the Cartfile for your project, add:
github "bitwiseio/sawtooth-sdk-swift" "master"
After the framework is downloaded and built, it can be found at
- Add the built .framework binaries to the Embedded Binaries and Linked Frameworks and Libraries sections in your Xcode project.
Generate private/public key pairs
import SawtoothSigning let context = Secp256k1Context() let privateKey = context.newRandomPrivateKey() let signer = Signer(context: context, privateKey: privateKey) let signature = signer.sign(data: message_bytes) context.verify(signature: signature, data: message_bytes, publicKey: signer.getPublicKey())
For full usage information, please refer to the Swift SDK documentation included in this repository.
To generate the Swift SDK documentation from source:
- Install sphinx.
pip install -U Sphinx
- Install the sphinx theme used by the Sawtooth documentation using pip.
pip install sphinx_rtd_theme
- In the
Sphinx generates the documentation and puts it in the folder
- To open the index file, run
Hyperledger Sawtooth software is licensed under the Apache License Version 2.0 software license.