Latest 1.0.3
Homepage https://github.com/goldennetwork/GoldenKeystore
License MIT
Platforms ios 9.0
Dependencies TrezorCrypto
Authors

A Swift library for generating keypairs from BIP32 and BIP39

Features

  • [x] Generate mnemonic (12/18/24 words)
  • [x] Check mnemonic if it is valid
  • [x] Generate Hierarchical Deterministic Key

Installation

CocoaPods

CocoaPods 1.3+ is required

In your Podfile:

platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'GoldenKeystore'
end

Run pod install from your terminal to install the library.

Usage

In your Swift file:

import GoldenKeystore

GoldenKeystore.generateMnemonic() // generate randomly 12 words
GoldenKeystore.generateMnemonic(strength: 256) // generate randomly 24 words

GoldenKeystore.mnemonicIsValid("YOUR_MNEMONIC") // true | false

// Default path: m/44'/60'/0'/0/index
let key = GoldenKeystore.createHDKeyPair(mnemonic: "YOU_MNEMONIC", index: 0)
key.publicKeyHex // 0x0123456
key.privateKeyHex // 0x0123456abc

// For custom path and passphrase
GoldenKeystore.createHDKeyPair(
  mnemonic: "YOU_MNEMONIC",
  passphrase: "YOU_PASSPHRASE",
  path: "m/44'/1'/0'/0/index",
  index: 0
) // Bitcoin HDKey

// Generate many keys in one call
let keys = GoldenKeystore.createHDKeyPairs(
  mnemonic: "YOU_MNEMONIC",
  passphrase: "YOU_PASSPHRASE",
  path: "m/44'/60'/0'/0/index",
  from: 0,
  to: 50
)

License

GoldenKeystore is released under the MIT license.

Latest podspec

{
    "name": "GoldenKeystore",
    "version": "1.0.3",
    "summary": "A Swift library for generating BIP32, BIP39 key pairs",
    "homepage": "https://github.com/goldennetwork/GoldenKeystore",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Viettranx": "[email protected]"
    },
    "source": {
        "git": "https://github.com/goldennetwork/GoldenKeystore.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "4.1",
    "source_files": "*.swift",
    "dependencies": {
        "TrezorCrypto": [
            "0.0.6"
        ]
    }
}

Pin It on Pinterest

Share This