Go to file
keefertaylor 6577eef3b9 Check in Xcode project 2019-11-03 17:27:48 -08:00
Examples/MnemonicKitExample.playground Fix style violations 2019-01-27 18:54:32 +00:00
MnemonicKit trim header 2019-10-28 00:02:10 -06:00
MnemonicKit.xcodeproj Check in Xcode project 2019-11-03 17:27:48 -08:00
Tests Validate that mnemonics are deterministic before creating seed strings 2019-04-26 17:35:52 +01:00
.gitignore Check in Xcode project 2019-11-03 17:27:48 -08:00
.slather.yml Update Slather for new scheme names 2019-10-28 00:40:37 -06:00
.swiftlint.yml Fix style violations 2019-01-27 18:54:32 +00:00
.travis.yml consolidate release phase 2019-11-03 11:19:47 -08:00
Cartfile Upgrade CryptoSwift dep, 0.13.1 -> 0.14.0 2019-02-16 17:33:03 +00:00
Cartfile.resolved Cleanup and Swift5 conversion. 2019-04-24 02:06:17 +01:00
Gemfile more build infra 2019-10-27 21:20:33 -06:00
LICENSE Initial commit 2017-07-24 21:59:55 +08:00
MnemonicKit.podspec more build infra 2019-10-27 21:20:33 -06:00
README.md more build infra 2019-10-27 21:20:33 -06:00
codecov.yml Update paths for codecov ignore 2019-01-27 18:46:50 +00:00
project.yml wire up project.yml 2019-10-27 21:28:48 -06:00

README.md

MnemonicKit

Build Status codecov Carthage Compatible Version License

An implementation of BIP39 in Swift. MnemonicKit supports both English and Chinese mnemonics.

This library is a fork of CKMnemonic. This fork provides several conveniences over the original library, namely:

  • Converting throwing APIs to non-throwing nullable APIs
  • Additional helper methods
  • Code clarity and documentation
  • Additional Testing
  • Support on OSX

Installation

CocoaPods

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

pod "MnemonicKit"

Carthage

If you use Carthage to manage your dependencies, simply add MnemonicKit to your Cartfile:

github "keefertaylor/MnemonicKit"

If you use Carthage to build your dependencies, make sure you have added CryptoSwift.framework to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase.

Usage

Generate a Mnemonic

  let englishMnemonic = Mnemonic.generateMnemonic(strength: 64, language: .english)
  let chineseMnemonic = Mnemonic.generateMnemonic(strength: 128, language: .chinese)

Generate a Mnemonic from a Hex Representation

  let hexRepresentation: String = ...
  let mnemonic = Mnemonic.mnemonicString(from: hexRepresentation)
  print("Mnemonic: \(mnemonic)\nFrom hex string: \(hexRepresentation)")

Generate a Seed String

  let englishMnemonic = Mnemonic.generateMnemonic(strength: 64, language: .english)
  let passphrase: String = ...
  let deterministicSeedString = Mnemonic.deterministicSeedString(from: mnemonicString,
                                                                 passphrase: passphrase,
                                                                 language: .english)
  print("Deterministic Seed String: \(deterministicSeedString)")

Contributions

I am happy to accept pull requests.

To get set up:

$ brew install xcodegen # if you don't already have it
$ xcodegen generate # Generate an XCode project from Project.yml
$ open MnemonicKit.xcodeproj

License

MIT