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

Overview

EthereumKit

EthereumKit is a Swift framework that enables you to create Ethereum wallet and use it in your app.

// BIP39: Generate seed and mnemonic sentence.

let mnemonic = Mnemonic.create()
let seed = Mnemonic.createSeed(mnemonic: mnemonic)

// BIP32: Key derivation and address generation

let wallet = try! Wallet(seed: seed, network: .main)

// Send some ether

let rawTransaction = RawTransaction(
    ether: try! Converter.toWei(ether: "0.00001"), 
    to: address, 
    gasPrice: Converter.toWei(GWei: 10), 
    gasLimit: 21000, 
    nonce: 0
)

let tx = try! wallet.signTransaction(rawTransaction)
geth.sendRawTransaction(rawTransaction: tx) { result in 
    // Do something...
}

Set up

  • Run make bootstrap

Features

  • Mnemonic recovery phrease in BIP39
  • BIP32/BIP44 HD wallet
  • EIP55 format address encoding
  • EIP155 replay attack protection
  • Sign transaction
  • ERC20 token transfer

Documentations

Requirements

  • Swift 4.0 or later
  • iOS 9.0 or later

Installation

Carthage

  • Insert github "yuzushioh/EthereumKit" to your Cartfile.
  • Run carthage update --platform ios.

Dependency

Apps using EthereumKit

Author

Ryo Fukuda, @yuzushioh, [email protected]

License

EthereumKit is released under the Apache License 2.0.

Comments
  • Can I send tokens via your kit?

    Can I send tokens via your kit?

    Hi @yuzushioh

    I have question. I need to send Ethereum's tokens (USDT). I know that for sending tokens i must match smart-contract data such as parameter of RawTransaction(field Data). Question: Do you how to resolve that question ?

    Thanks

    opened by Dubickiy 17
  • Logo Proporsal: EthereumKit

    Logo Proporsal: EthereumKit

    Hey, I'm graphic designer and my aim is supporting open source projects and make my portfolio better. So, I can contribute on your project with making logo design. I am waiting your feedback! Have a nice day! :)

    Best Regards, TJ Ulises Visual Communication Designer

    opened by tjulises 13
  • how can i install ethereumkit on xcode

    how can i install ethereumkit on xcode

    i have try install the ethereumkit on xcode , but its some errors or showed how can i overcome please replay to me ,

    Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project /Volumes/Carthage/Checkouts/EthereumKit/EthereumKit.xcodeproj -scheme EthereumKit -configuration Release -derivedDataPath /Users/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/EthereumKit/1.0.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/nc/_cswghbx2gdg0tx4j8xfz2mc0000gn/T/EthereumKit SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Volumes/ios/new2018/Carthage/Checkouts/EthereumKit)

    This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/nc/_cswghbx2gdg0tx4j8xfz2mc0000gn/T/carthage-xcodebuild.HWFpZf.log

    opened by jesuasir007 13
  • secp256k1 module error

    secp256k1 module error

    ya , ethereumkit installation is completed , i have add an ethereumkit module its shows some error,please check me .Missing required module 'secp256k1'

    opened by jesuasir007 11
  • transaction error

    transaction error

    JSONRPCError.responseError(code: -32000, message: "insufficient funds for gas * price + value", data: nil)

    an error occurred when i sendrawTransction

    opened by cadaverousblue 7
  • Xcode 10.2 compiler freezes on SentTransaction.swift

    Xcode 10.2 compiler freezes on SentTransaction.swift

    When I update the project and rebuild the carthage frameworks, and then build the project for release scheme (Cmd+Shift+I), then the compilation freezes on the SentTransaction.swift file and the build doesn't go anywhere.

    Currently, I have no idea why this happens.

    opened by DmitryBespalov 5
  • Updated CryptoSwift to 1.0.0 and dependency version to 9.0

    Updated CryptoSwift to 1.0.0 and dependency version to 9.0

    Hello! Thanks a lot for your package, great job!

    Carthage version: 0.29.0. Swift version: 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2). Target: x86_64-apple-darwin17.5.0.

    But today, after your changes, when you updated CryptoSwift to 0.10.0 and dependency version to 9.0, I have the following situation after carthage update --platform iOS:

    screen shot 2018-05-30 at 4 13 23 pm

    So dependency was skipped and I cannot to use its secp256k1. I tried to use --no-use-binaries flag (as Google prompted), then I gave within logs:

    CryptoEthereumSwift/CryptoEthereumSwift/Source/EllipticCurveEncrypterSecp256k1.swift:2:8:
    error: module file's minimum deployment target is ios9.0 v9.0
    

    Although I already have 11.3.

    I have change github "krzyzanowskim/CryptoSwift" "0.9.0" to github "krzyzanowskim/CryptoSwift" "0.10.0" in my Cartfile directly and all my "installation" problems has expired.

    But again, I have the following problem:

    let wallet: Wallet = Wallet(network: .main, privateKey: privateKey)
    compiler error: Type of expression is ambiguous without more context
    

    When I change it to the following code:

    let wallet: Wallet = Wallet(network: .main, privateKey: UserData.privateKey, debugPrints: true)
    

    I get:

    screen shot 2018-05-30 at 7 06 33 pm

    Can you help me?

    opened by dmytrostriletskyi 5
  • carthage update  error

    carthage update error

    Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project /Users/fanpeng/Desktop/teestWallet/Carthage/Checkouts/EthereumKit/EthereumKit.xcodeproj -scheme EthereumKit -configuration Release -derivedDataPath /Users/fanpeng/Library/Caches/org.carthage.CarthageKit/DerivedData/9.2_9C40b/EthereumKit/1.0.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/_l/zg5_vygj6mb_8r9gz_rsvmhr0000gn/T/EthereumKit SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/fanpeng/Desktop/teestWallet/Carthage/Checkouts/EthereumKit)

    This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/_l/zg5_vygj6mb_8r9gz_rsvmhr0000gn/T/carthage-xcodebuild.y1ltLd.log

    opened by TheCodeor 4
  • Possible issue with

    Possible issue with "compressed: true"

    https://github.com/D-Technologies/EthereumKit/blob/58bb34623a9d0cdd14eebe9f58a559956900f166/EthereumKit/Key/HDPublicKey.swift#L12

    Hi, I am not sure if it is correct that "compressed: true" is used in this place. Could it be a potential issue, or should it be like that?

    opened by sche 3
  • Issue with BDouble

    Issue with BDouble

    See my debug process:

    (lldb) po wallet.ether?.description
    ▿ Optional<String>
      - some : "399979/1000000"
    
    (lldb) po wallet.ether?.decimalExpansion(precisionAfterComma: 4)
    ▿ Optional<String>
      - some : "0.0000"
    
    (lldb) po wallet.ether?.decimalExpansion(precisionAfterComma: 5)
    ▿ Optional<String>
      - some : "0.00000"
    
    (lldb) po wallet.ether?.decimalExpansion(precisionAfterComma: 6)
    ▿ Optional<String>
      - some : "0.399979"
    
    (lldb) po wallet.ether?.decimalExpansion(precisionAfterComma: 8)
    ▿ Optional<String>
      - some : "0.39997900"
    

    wallet.ether is a EthereumKit.BDouble

    It's so strange if I do not put enough precision to represent the floating number, it will always return 0.000...

    opened by yijiasu 3
  • (1.1.1) Build failed

    (1.1.1) Build failed

    Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project /Users/jakelaurie/Development/ECDSATest/Carthage/Checkouts/EthereumKit/EthereumKit.xcodeproj -scheme EthereumKit -configuration Release -derivedDataPath /Users/jakelaurie/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/EthereumKit/1.1.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/m9/ngjbz9rs0qq9fbymnkm6r4zh0000gn/T/EthereumKit SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/jakelaurie/Development/ECDSATest/Carthage/Checkouts/EthereumKit)

    opened by jakeroam 3
  •  When I run the sample project, an error occurs.

    When I run the sample project, an error occurs.

    dyld: Library not loaded: @rpath/CryptoEthereumSwift.framework/CryptoEthereumSwift Referenced from: /private/var/containers/Bundle/Application/A44CC033-7BE7-4FCD-9F80-4D7211071568/Example.app/Example Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/A44CC033-7BE7-4FCD-9F80-4D7211071568/Example.app/Frameworks/CryptoEthereumSwift.framework/CryptoEthereumSwift: code signature invalid for '/private/var/containers/Bundle/Application/A44CC033-7BE7-4FCD-9F80-4D7211071568/Example.app/Frameworks/CryptoEthereumSwift.framework/CryptoEthereumSwift'

    in my project

    dyld: Symbol not found: _$s11CryptoSwift4SHA3C7VariantO9keccak256yA2EmFWC Referenced from: /Users/oleksii/Library/Developer/CoreSimulator/Devices/DF5883B7-E1DF-42E1-87E2-5700D9D91F7E/data/Containers/Bundle/Application/4E5AD034-CFCE-4A60-A6B4-0CEF0257DD38/BitFreezer.app/Frameworks/CryptoEthereumSwift.framework/CryptoEthereumSwift Expected in: /Users/oleksii/Library/Developer/CoreSimulator/Devices/DF5883B7-E1DF-42E1-87E2-5700D9D91F7E/data/Containers/Bundle/Application/4E5AD034-CFCE-4A60-A6B4-0CEF0257DD38/BitFreezer.app/Frameworks/CryptoSwift.framework/CryptoSwift in /Users/oleksii/Library/Developer/CoreSimulator/Devices/DF5883B7-E1DF-42E1-87E2-5700D9D91F7E/data/Containers/Bundle/Application/4E5AD034-CFCE-4A60-A6B4-0CEF0257DD38/BitFreezer.app/Frameworks/CryptoEthereumSwift.framework/CryptoEthereumSwift

    opened by OleksiiShulzhenko 3
  • HDWallet.privateKey().raw returns 31 byte key instead of 32-byte

    HDWallet.privateKey().raw returns 31 byte key instead of 32-byte

    This code returns private key data with a length of 31 byte, which is not correct. The data doesn't have leading zero byte.

            let mnemonic = "half try deer tray hockey ball notable abstract affair main desert session"
            let seed = Mnemonic.createSeed(mnemonic: mnemonic)
            let hdWallet = HDWallet(seed: seed, network: Network.private(chainID: 0, testUse: false))
            let privateKey = try! hdWallet.privateKey(at: 1).raw
    

    The expected private key is 0x007179e85007a04d2a9cae63be80326aa2c218f75394b7d37ccd1b660c8b180d but the actual is 0x7179e85007a04d2a9cae63be80326aa2c218f75394b7d37ccd1b660c8b180d .

    opened by DmitryBespalov 1
  • URL request timeout is hard-coded to 10 seconds, need to have it as default (60 seconds)

    URL request timeout is hard-coded to 10 seconds, need to have it as default (60 seconds)

    Currently, requests made through http client are getting 10 seconds timeout, but it is too short for a real world use case. It would be good to have it either set back to default value (60 seconds) or ability to provide this value by library users.

    opened by DmitryBespalov 0
  • The infra endpoint has changed, so we need to fix it.

    The infra endpoint has changed, so we need to fix it.

    Infra's Endpoint has change https://mainnet.infura.io/{project ID} to https://mainnet.infura.io/v3/{project ID}. so we need to fix it. Otherwise, the new endpoint of infra doesn't work.

    opened by TaikiKawa 1
Releases(2.0.1)
Owner
Ryo Fukuda
yuzushioh
Ryo Fukuda
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
An open-source Ethereum wallet built with SwiftUI

lil wallet welcome to lil wallet. it's an open-source Ethereum wallet built with SwiftUI there are two main views - coins and objects. coins are your

Jordan Singer 140 Jan 3, 2023
AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

AlphaWallet - Advanced, Open Source Ethereum Mobile Wallet & dApp Browser for iOS

AlphaWallet 475 Jan 5, 2023
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
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
Web3keystore - Ethereum keystore logic, in Swift

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

Brian Wagner 0 Feb 12, 2022
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

null 16 Nov 25, 2022
Wei Wallet - Ethereum wallet app for iOS

Wei Wallet - Ethereum wallet app for iOS Getting Started Download the latest Xcode Clone this repository Install Carthage, Cocoapods Run make bootstra

Popshoot, Inc. 277 Nov 17, 2022
Multi-wallet for Bitcoin, Ethereum, Binance Smart Chain and other emerging blockchains

Multi-wallet for Bitcoin, Ethereum, Binance Smart Chain and other emerging blockchains. Non-custodial storage, decentralized exchange, and extensive analytics for thousands of tokens and NFTs. Implemented on Swift.

Horizontal Systems 446 Jan 3, 2023
Trust - Ethereum Wallet and Web3 DApp Browser for iOS

Trust - Ethereum Wallet and Web3 DApp Browser for iOS Welcome to Trust's open source iOS app! Getting Started Download the Xcode 9 release. Clone this

Trust Wallet 1.4k Dec 31, 2022
Rainbow - 🌈the Ethereum wallet that lives in your pocket

??️ the Ethereum wallet that lives in your pocket! ??️ Available on the iOS App Store. ?? Android Beta available on Google Play Store ??️ Foll

Rainbow 3.2k Jan 3, 2023
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
Kukai Crypto Swift is a native Swift library for creating regular or HD wallets for the Tezos blockchain

Kukai Crypto Swift Kukai Crypto Swift is a native Swift library for creating regular and HD key pairs for the Tezos blockchain. Supporting both TZ1 (E

Kukai Wallet 2 Aug 18, 2022
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

Yenom - The simplest Bitcoin wallet - 786 Dec 25, 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
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

Felipe Ricieri 5 Sep 25, 2022
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

Pasquale Ambrosini 5 Jun 13, 2022
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

Alexey Strokin 3 Aug 18, 2022