Latest 0.1.9
License MIT
Platforms ios 9.0


CI Status


To run the example project, clone the repo, and run pod install from the Example directory first.


This project uses Swift 4 and will only run on XCode 9+ (in beta at the time of writing). To download a beta of xcode 9, see

For a swift 3 compatible version, please see release v0.1.9


BlockstackCoreApi is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "BlockstackCoreApi-iOS"

Usage – Authorization

1- create a unique app id for your blockstack app, such as 910412354
2- in your info.plist, you must add the following entry allowing the blockstack app to open your application after authorization


also add blockstack to your query schemes so that the app is allowed to verify blockstack is installed


3- In your app delegate, did open url method, you must pass on the authorization response from blockstack

//in order to complete the authorization process we must call the browser auth openURL method so it may
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
    if let scheme = url.scheme, scheme.contains("bs")
        return BSBrowserAuth.application(app, open: url, options: options)
    return false

4- Now, you may verify the blockstack app is installed and that authorization can be completed with:

//verify blockstack is installed.
guard BSBrowserAuth.canAuthorize() == true else

For more info on install the portal application see:

5- To call blockstack for authorization:

BSBrowserAuth.authorize(appId: "777", name: "HelloBlockStack") { (token) in
    if let token = token
        //app authorized. Use the provided token

Usage Core API

The blockstack core api can be accessed via BSCoreApi
For a listing of all the api methods and documentation see

func ping()
{ { (result, error) in }

func allNames()
    BSCoreApi.allNames { (result, error) in }

func nameInfo(){
    BSCoreApi.nameInfo(for: "", { (result, error) in })

func zoneFile(){
    BSCoreApi.zoneFile(for: "", with: "b100a68235244b012854a95f9114695679002af9", { (result, error) in })

func namesOwned(){
    BSCoreApi.namesOwned(on: "bitcoin", for: "1Q3K7ymNVycu3TQoTDUaty8Q5fUVB3feEQ", { (result, error) in })

func allNamespaces(){
    BSCoreApi.allNamespaces({ (result, error) in })

func namespaceNames(){
    BSCoreApi.namespaceNames(namespace: "id") { (result, error) in }

func namespacePrice(){
    BSCoreApi.namespacePrice(namespace: "cnn") { (result, error) in }

func namePrice(){
    BSCoreApi.namePrice(name: "") { (result, error) in }

func consensusHash(){
    BSCoreApi.consensusHash(blockchain: "bitcoin") { (result, error) in }

func pendingTransactions(){
    BSCoreApi.pendingTransactions(blockchain: "bitcoin") { (result, error) in }

func userProfile(){
    BSCoreApi.userProfile(username: "fredwilson") { (result, error) in }

func search(){ "ja") { (result, error) in }


Logan Sease, [email protected]


BlockstackCoreApi is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "BlockstackCoreApi-iOS",
    "version": "0.1.9",
    "summary": "A pod for interacting with blockstack core,",
    "description": "This pod allows you to perform lookups against the blockstack core api from your mobile apps and to authorize your app tonaccess user data from the blockstack platform",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Logan Sease": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.9"
    "platforms": {
        "ios": "9.0"
    "source_files": "BlockstackCoreApi/Classes/**/*",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This