Kukai Crypto Swift is a native Swift library for creating regular or HD wallets for the Tezos blockchain

Overview

Kukai Crypto Swift

Platforms Swift Package Manager License

Kukai Crypto Swift is a native Swift library for creating regular and HD key pairs for the Tezos blockchain. Supporting both TZ1 (Ed25519) and TZ2 (secp256k1) for regular pairs, and TZ1 (Ed25519 (BIP44 via SLIP-0010)) for HD pairs.


Feature set includes:
  • Create BIP39 mnemonics in English or Chinese
  • Generate a cryptographic seed from a Menmonic in a tiny fraction of a second
  • Create TZ1 or TZ2 key pair from a seed
  • Derive HD key pair from a seed and derivation path
  • Support for optional passwords

Based off:

Install

Kukai Crypto Swift supports the Swift Package Manager. Either use the Xcode editor to add to your project by clicking File -> Swift Packages -> Add Package Dependency, search for the git repo https://github.com/kukai-wallet/kukai-crypto-swift.git and choose from version 1.0.0.

Or add it to your Package.swift dependencies like so:

dependencies: [
    .package(url: "https://github.com/kukai-wallet/kukai-crypto-swift", from: "1.0.0")
]


How to use

Create a new Mnemonic

let mnemonic = try Mnemonic(numberOfWords: .twentyFour)

Create a Mnemonic from an existing phrase

let mnemonic = try Mnemonic(seedPhrase: "remember smile trip tumble era cube worry fuel bracket eight kitten inform")

Create a regular key pair and get a Tezos address

let keyPair = KeyPair.regular(fromMnemonic: mnemonic, passphrase: "", andSigningCurve: .ed25519)

print(keyPair.publicKey.publicKeyHash) // tz1T3QZ5w4K11RS3vy4TXiZepraV9R5GzsxG
let keyPair = KeyPair.regular(fromMnemonic: mnemonic, passphrase: "", andSigningCurve: .secp256k1)

print(keyPair.publicKey.publicKeyHash) // tz2UiZQJwaVAKxRuYxV8Tx5k8a64gZx1ZwYJ

Create a HD key pair

let keyPair = KeyPair.hd(fromMnemonic: mnemonic, passphrase: "", andDerivationPath: "44'/1729'/0'/0'")

Sign a message

let messageToSign = "something very interesting that needs to be signed".bytes
let result = keyPair.privateKey.sign(bytes: messageToSign)

print("Result hex: \(result.hexString)") // c4d20c77d627d8c07e....


Documentation

Compiled Swift Doc's can be found here

You might also like...
EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.
EthereumKit is a free, open-source Swift framework for easily interacting with the Ethereum.

EthereumKit is a Swift framework that enables you to create Ethereum wallet and use it in your app. // BIP39: Generate seed and mnemonic sentence. le

Bitcoin protocol toolkit for Swift
Bitcoin protocol toolkit for Swift

Welcome to BitcoinKit The BitcoinKit library is a Swift implementation of the Bitcoin protocol which support both BCH and BTC. Improving the mobile ec

IOTA wallet.rs Swift binding

IOTA wallet.rs Swift Binding Swift binding for the official wallet.rs Rust library for IOTA Ledger. The Swift binding links and communicates with the

Web3keystore - Ethereum keystore logic, in Swift

web3keystore A module for creating and interacting with Ethereum keystores. Hand

A swift utility to resolve Ethereum Domain Names.

ENSKit A swift utility to resolve Ethereum Domain Names per EIP-137. Examples Initializing: // Use default options with Cloudflare Ethereum Gateway le

Modern Swift implementations of BIP39, BIP32, and BIP44
Modern Swift implementations of BIP39, BIP32, and BIP44

PLEASE NOTE! This is fork from KevinVitale/WalletKit Due to SPM (Swift package manager) and github restrictions it's impossible to add original KevinV

BitcoinCore for Bitcoin, BitcoinCash(ABC), Litecoin and Dash wallet toolkit for Swift.

BitcoinCore for Bitcoin, BitcoinCash(ABC), Litecoin and Dash wallet toolkit for Swift. This is a full implementation of SPV node including wallet creation/restore, synchronization with network, send/receive transactions, and more.

iOS client for the TradeOgre.com crypto-to-crypto trading platform

TradeOgre iOS Overview TradeOgre iOS is an iOS client for the TrageOgre.com website and crypto-exchange platform. I was looking for their iOS client,

Swift SDK to interact with the Flow Blockchain

Flow Swift SDK The Flow Swift SDK is a Swift gRPC client for Flow. Currently the following Flow Access API methods have been

A simple Proof-of-Work Blockchain built in Swift

Blockchain in Swift A simple Proof-of-Work Blockchain built in Swift. Requirements Xcode 13.0 Swift 5.2 Vapor 4.49 Swift NIO 2.33.0 Getting started Cl

Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Introduction EtherWalletKit is an Ethereum Wallet Toolkit for iOS. I hope cryptocurrency and decentralized token economy become more widely adapted. H

Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Introduction EtherWalletKit is an Ethereum Wallet Toolkit for iOS. I hope cryptocurrency and decentralized token economy become more widely adapted. H

SwiftVerbalExpressions is a Swift library that helps to construct difficult regular expressions

SwiftVerbalExpressions Swift Regular Expressions made easy SwiftVerbalExpressions is a Swift library that helps to construct difficult regular express

A Cross-Platform String and Regular Expression Library written in Swift.

Guitar 🎸 A Cross-Platform String and Regular Expression Library written in Swift. About This library seeks to add common string manipulation function

Lint anything by combining the power of Swift & regular expressions.
Lint anything by combining the power of Swift & regular expressions.

Installation • Getting Started • Configuration • Xcode Build Script • Donation • Issues • Regex Cheat Sheet • License AnyLint Lint any project in any

Regular expressions for swift
Regular expressions for swift

Regex Advanced regular expressions for Swift Goals Regex library was mainly introduced to fulfill the needs of Swift Express - web application server

A delightful and expressive regular expression type for Swift.

Regex Pattern match like a boss. Usage Create: // Use `Regex.init(_:)` to build a regex from a static pattern let greeting = Regex("hello (world|univ

Regular expressions for swift
Regular expressions for swift

Regex Advanced regular expressions for Swift Goals Regex library was mainly introduced to fulfill the needs of Swift Express - web application server

Swifty regular expressions

Regex Swifty regular expressions This is a wrapper for NSRegularExpression that makes it more convenient and type-safe to use regular expressions in S

Owner
Kukai Wallet
Kukai Wallet
Ethereum Wallet Toolkit for iOS - You can implement an Ethereum wallet without a server and blockchain knowledge.

Introduction EtherWalletKit is an Ethereum Wallet Toolkit for iOS. I hope cryptocurrency and decentralized token economy become more widely adapted. H

Sung Woo Chang 136 Dec 25, 2022
CryptoSwift - Crypto related functions and helpers for Swift implemented in Swift

CryptoSwift Crypto related functions and helpers for Swift implemented in Swift.

Kushal Shingote 2 Feb 6, 2022
Swift UI component - Stories instagram, slideshow, crypto wallet intro

SwiftUI and Combine - Stories intro multi-platform widget Features Long tap - pause stories showcase Tap - next story Leeway - pause before start stor

Igor 9 Dec 26, 2022
CryptoTrackerMenuBar - A Realtime Crypto Tracker macOS Menu Bar App built with SwiftUI & WebSocket

Realtime Crypto Tracker macOS Menu Bar App - SwiftUI & WebSocket A Realtime Cryp

Alfian Losari 21 Dec 15, 2022
Cross-platform 👻 Crypto Wallet Generator in Go

coingrig-go-wallet Cross-platform ?? Crypto Wallet Generator in Go Build Run ./build.sh Artifacts iOS .xcframework is in ios/ directory Android .jar a

Coingrig 2 Feb 26, 2022
Elegant Web3js functionality in Swift. Native ABI parsing and smart contract interactions on Ethereum network.

You can ask for help in our Discord Channel web3swift Swift implementation of web3.js functionality ⚡ Interaction with remote node via JSON RPC ?? Sma

BANKEX - Proof-of-Asset Protocol 487 Mar 25, 2022
Ethereum-wallet: 100% native ethereum wallet, created with iOS version of Geth client

Ethereum-wallet: 100% native ethereum wallet, created with iOS version of Geth client

DE MINING 4 Dec 11, 2022
A pure swift Ethereum Web3 library

⚗️ Web3 Web3.swift is a Swift library for signing transactions and interacting with Smart Contracts in the Ethereum Network. It allows you to connect

null 484 Dec 16, 2022
This library provides convenient way to use Coinpaprika.com API in Swift.

Coinpaprika API Swift Client Documentation | Repository | Installation Usage This library provides convenient way to use Coinpaprika.com API in Swift.

Coinpaprika 30 Dec 21, 2021
Full Bitcoin library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash and Dash blockchains.

BitcoinKit-iOS Bitcoin, BitcoinCash(ABC) and Dash wallet toolkit for Swift. This is a full implementation of SPV node including wallet creation/restor

Horizontal Systems 231 Dec 2, 2022