Swift implementation without dependencies of Trezor's python-mnemonic
, i.e. BIP-0039.
to_hd_master_key
is missing as it would require to include a library for Base 58 or port an implementation such as libbase58.
Coming soon (really useful for Expo native modules).
To integrate using Apple's Swift Package Manager, add the following as a dependency to your Package.swift
:
dependencies: [
.package(url: "git@github.com:yopaki/bip39-swift.git", from: "1.0.0")
]
Alternatively navigate to your Xcode project, select Swift Packages
and click the +
icon to search for this package.
If you prefer not to use any of the aforementioned dependency managers, you can integrate BIP39 into your project manually. Simply drag the Sources
Folder into your Xcode project.
The tests cover the recommended vectors in BIP-0039, i.e. the vectors in
- https://github.com/trezor/python-mnemonic/blob/master/vectors.json
- https://github.com/bip32JP/bip32JP.github.io/blob/master/test_JP_BIP39.json
Additionally, via GitHub Actions we check that these vectors as well as the word lists for all languages are the same as python-mnemonic
's.