diff --git a/Documentation/Usage.md b/Documentation/Usage.md index 0b906f308..a5310f799 100755 --- a/Documentation/Usage.md +++ b/Documentation/Usage.md @@ -7,71 +7,71 @@ - [About source and GitHub repositories](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#about-source-and-github-repositories) -- [Introduction](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#introduction) - - [Preffered models](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#preffered-models) - - [Preffered keys Wallet Model (Account)](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#preffered-keys-wallet-model-account) - - [Preffered ERC-20 Model](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#preffered-erc-20-model) -- [Account Management](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#account-management) - - [Create Account](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#create-account) - - [With Private Key](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#with-private-key) - - [With Mnemonics Phrase](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#with-mnemonics-phrase) - - [Import Account](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#import-account) - - [With Private Key](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#with-private-key-1) - - [With Mnemonics Phrase](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#with-mnemonics-phrase-1) - - [Get Keystore Manager from wallet data](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-keystore-manager-from-wallet-data) - - [Get wallet private key](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-wallet-private-key) -- [Ethereum Endpoints interaction](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#ethereum-endpoints-interaction) - - [web3 instance](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#web3-instance) - - [Ethereum Address](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#ethereum-address) - - [Initializing](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#initializing) - - [Get Balance](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-balance) - - [Get ETH balance](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-eth-balance) - - [Get ERC20 token balance](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-erc20-token-balance) - - [Transactions Operations](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#transactions-operations) - - [Prepare Transaction](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#prepare-transaction) - - [Send Ether](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#send-ether) - - [Send ERC-20 Token](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#send-erc-20-token) - - [Write Transaction and call smart contract method](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#write-transaction-and-call-smart-contract-method) - - [Read Transaction to call smart contract method](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#read-transaction-to-call-smart-contract-method) - - [Send Transaction](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#send-transaction) - - [Write](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#write) - - [Read](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#read) - - [Chain state](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#chain-state) - - [Get Block number](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-block-number) -- [Websockets](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#websockets) - - [Web3socketDelegate](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#web3socketdelegate) - - [Custom Websocket Provider](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#custom-websocket-provider) - - [Connect to custom endpoint](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#connect-to-custom-endpoint) - - [Send message](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#send-message) - - [Infura Websocket interactions](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#infura-websocket-interactions) - - [Connect to Infura endpoint](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#connect-to-infura-endpoint) - - [Connect to custom Infura-like endpoint](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#connect-to-custom-infura-like-endpoint) - - [Create a filter in the node to notify when something happened](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#create-a-filter-in-the-node-to-notify-when-something-happened) - - [Get new pending transactions](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#get-new-pending-transactions) - - [Create a new subscription over particular events](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#create-a-new-subscription-over-particular-events) - - [Subscribe on new pending transactions](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#subscribe-on-new-pending-transactions) -- [ENS](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#ens) - - [Registry](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#registry) - - [Resolver](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#resolver) - - [BaseRegistrar](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#baseregistrar) - - [RegistrarController](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#registrarcontroller) - - [ReverseRegistrar](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#reverseregistrar) +- [Introduction](#introduction) + - [Preffered models](#preffered-models) + - [Preferred keys Wallet Model (Account)](#preferred-keys-wallet-model-account) + - [Preffered ERC-20 Model](#preffered-erc-20-model) +- [Account Management](#account-management) + - [Create Account](#create-account) + - [With Private Key](#with-private-key) + - [With Mnemonics Phrase](#with-mnemonics-phrase) + - [Import Account](#import-account) + - [With Private Key](#with-private-key-1) + - [With Mnemonics Phrase](#with-mnemonics-phrase-1) + - [Get Keystore Manager from wallet data](#get-keystore-manager-from-wallet-data) + - [Get private key](#get-private-key) +- [Ethereum Endpoints interaction](#ethereum-endpoints-interaction) + - [web3 instance](#web3-instance) + - [Ethereum Address](#ethereum-address) + - [Initializing](#initializing) + - [Get Balance](#get-balance) + - [Get ETH balance](#get-eth-balance) + - [Get ERC20 token balance](#get-erc20-token-balance) + - [Transactions Operations](#transactions-operations) + - [Prepare Transaction](#prepare-transaction) + - [Send Ether](#send-ether) + - [Send ERC-20 Token](#send-erc-20-token) + - [Write Transaction and call smart contract method](#write-transaction-and-call-smart-contract-method) + - [Read Transaction to call smart contract method](#read-transaction-to-call-smart-contract-method) + - [Send Transaction](#send-transaction) + - [Write](#write) + - [Read](#read) + - [Chain state](#chain-state) + - [Get Block number](#get-block-number) +- [Websockets](#websockets) + - [Web3socketDelegate](#web3socketdelegate) + - [Custom Websocket Provider](#custom-websocket-provider) + - [Connect to custom endpoint](#connect-to-custom-endpoint) + - [Send message](#send-message) + - [Infura Websocket interactions](#infura-websocket-interactions) + - [Connect to Infura endpoint](#connect-to-infura-endpoint) + - [Connect to custom Infura-like endpoint](#connect-to-custom-infura-like-endpoint) + - [Create a filter in the node to notify when something happened](#create-a-filter-in-the-node-to-notify-when-something-happened) + - [Get new pending transactions](#get-new-pending-transactions) + - [Create a new subscription over particular events](#create-a-new-subscription-over-particular-events) + - [Subscribe on new pending transactions](#subscribe-on-new-pending-transactions) +- [ENS](#ens) + - [Registry](#registry) + - [Resolver](#resolver) + - [BaseRegistrar](#baseregistrar) + - [RegistrarController](#registrarcontroller) + - [ReverseRegistrar](#reverseregistrar) ## Introduction -To work with platforms based on blockchain technology, in particular with Ethereum-like blockchains, developer must be fluent in concepts such as a crypto wallet, private and public key, smart contract, token and others. We will use these concepts without explaining their meanings. For more information about Ethereum, we recommend reading the book [Mastering Ethereum](https://github.com/ethereumbook/ethereumbook), by Andreas M. Antonopoulos and Gavin Wood. +To work with platforms based on blockchain technology, in particular with Ethereum-like blockchains, a developer must be fluent in concepts such as a crypto wallet, private and public key, smart contract, token and others. We will use these concepts without explaining their meanings. For more information about Ethereum, we recommend reading the book [Mastering Ethereum](https://github.com/ethereumbook/ethereumbook), by Andreas M. Antonopoulos and Gavin Wood. -**To create keystore we forced our users to use some password, which will be used in some operations, like transactions sending. We believe that security is important for such operations and this increases its level. You are free to use a pre-compiled password in your code, that is not set by the keystore user, at your own risk.** +**To create keystore we forced our users to use some password, which will be used in some operations, like transactions sending. We believe that security is essential for such, and this increases its level. You are free to use a pre-compiled password in your code, that is not set by the keystore user, at your own risk.** *In code examples we used force-unwrapped Swift optionals for better readability of example code. We recommend that you do not use this method to get rid of optional values.* ### Preffered models -To describe the library's capabilities, we will use the models described below, however you can use the models that are convenient for you. +To describe the library's capabilities, we will use the models described below. However, you can use the models that are convenient for you. -#### Preffered keys Wallet Model (Account) +#### Preferred keys Wallet Model (Account) ```swift struct Wallet { @@ -120,10 +120,10 @@ let password = "web3swift" let bitsOfEntropy: Int = 128 // Entropy is a measure of password strength. Usually used 128 or 256 bits. let mnemonics = try! BIP39.generateMnemonics(bitsOfEntropy: bitsOfEntropy)! let keystore = try! BIP32Keystore( - mnemonics: mnemonics, - password: password, - mnemonicsPassword: "", - language: .english)! + mnemonics: mnemonics, + password: password, + mnemonicsPassword: "", + language: .english)! let name = "New HD Wallet" let keyData = try! JSONEncoder().encode(keystore.keystoreParams) let address = keystore.addresses!.first!.address @@ -152,10 +152,10 @@ let wallet = Wallet(address: address, data: keyData, name: name, isHD: false) let password = "web3swift" let mnemonics = "fine have legal roof fury bread egg knee wrong idea must edit" // Some mnemonic phrase let keystore = try! BIP32Keystore( - mnemonics: mnemonics, - password: password, - mnemonicsPassword: "", - language: .english)! + mnemonics: mnemonics, + password: password, + mnemonicsPassword: "", + language: .english)! let name = "New HD Wallet" let keyData = try! JSONEncoder().encode(keystore.keystoreParams) let address = keystore.addresses!.first!.address @@ -168,15 +168,15 @@ let wallet = Wallet(address: address, data: keyData, name: name, isHD: true) let data = wallet.data let keystoreManager: KeystoreManager if wallet.isHD { - let keystore = BIP32Keystore(data)! - keystoreManager = KeystoreManager([keystore]) + let keystore = BIP32Keystore(data)! + keystoreManager = KeystoreManager([keystore]) } else { - let keystore = EthereumKeystoreV3(data)! - keystoreManager = KeystoreManager([keystore]) + let keystore = EthereumKeystoreV3(data)! + keystoreManager = KeystoreManager([keystore]) } ``` -### Get wallet private key +### Get private key ```swift let password = "web3swift" @@ -237,10 +237,10 @@ options.gasPrice = .automatic options.gasLimit = .automatic let method = "balanceOf" let tx = contract.read( - method, - parameters: [exploredAddress] as [AnyObject], - extraData: Data(), - transactionOptions: options)! + method, + parameters: [exploredAddress] as [AnyObject], + extraData: Data(), + transactionOptions: options)! let tokenBalance = try! tx.call() let balanceBigUInt = tokenBalance["0"] as! BigUInt let balanceString = Web3.Utils.formatToEthereumUnits(balanceResult, toUnits: .eth, decimals: 3)! @@ -264,10 +264,10 @@ options.from = walletAddress options.gasPrice = .automatic options.gasLimit = .automatic let tx = contract.write( - "fallback", - parameters: [AnyObject](), - extraData: Data(), - transactionOptions: options)! + "fallback", + parameters: [AnyObject](), + extraData: Data(), + transactionOptions: options)! ``` ##### Send ERC-20 Token @@ -286,10 +286,10 @@ options.gasPrice = .automatic options.gasLimit = .automatic let method = "transfer" let tx = contract.write( - method, - parameters: [toAddress, amount] as [AnyObject], - extraData: Data(), - transactionOptions: options)! + method, + parameters: [toAddress, amount] as [AnyObject], + extraData: Data(), + transactionOptions: options)! ``` ##### Write Transaction and call smart contract method @@ -311,10 +311,10 @@ options.from = walletAddress options.gasPrice = .automatic options.gasLimit = .automatic let tx = contract.write( - contractMethod, - parameters: parameters, - extraData: extraData, - transactionOptions: options)! + contractMethod, + parameters: parameters, + extraData: extraData, + transactionOptions: options)! ``` ##### Read Transaction to call smart contract method @@ -333,10 +333,10 @@ options.from = walletAddress options.gasPrice = .automatic options.gasLimit = .automatic let tx = contract.read( - contractMethod, - parameters: parameters, - extraData: extraData, - transactionOptions: options)! + contractMethod, + parameters: parameters, + extraData: extraData, + transactionOptions: options)! ``` #### Send Transaction @@ -366,17 +366,17 @@ let blockNumber = try! web3.eth.getBlockNumber() ### Web3socketDelegate -To receive messages from endpoint you need to create a class that adopt to Web3SocketDelegate protocol. -Later, in order to open a connection to WebSocket server, you will use socket provider (WebsocketProvider or InfuraWebsocketProvider). And we recommend you to make it a property, so it doesn't get deallocated right after being setup. +To receive messages from endpoint you need to create a class that adopts to Web3SocketDelegate protocol. +Later, to open a connection to WebSocket server, you will use socket provider (`WebsocketProvider` or `InfuraWebsocketProvider`). And we recommend you to make it a property, so it doesn't get deallocated right after being setup. ```swift class DelegateClass: Web3SocketDelegate { - var socketProvider: WebsocketProvider? = nil // WebSocket Provider - var socketProvider: InfuraWebsocketProvider? = nil // Infura WebSocket Provider + var socketProvider: WebsocketProvider? = nil // WebSocket Provider + var socketProvider: InfuraWebsocketProvider? = nil // Infura WebSocket Provider - // Protocol method, here will be messages, received from WebSocket server - func received(message: Any) { - // Make something with message - } + // Protocol method, here will be messages, received from WebSocket server + func received(message: Any) { + // Make something with message + } } ``` diff --git a/README.md b/README.md index ba459a847..54b194362 100755 --- a/README.md +++ b/README.md @@ -55,28 +55,28 @@ - [x] Supports Web3View functionality - WKWebView with injected "web3" provider - [x] Possibility to add or remove "middleware" that intercepts, modifies and even cancel transaction workflow on stages "before assembly", "after assembly"and "before submission" - [x] Literally following the standards: - - [x] [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD Wallets: Deterministic Wallet - - [x] [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (Seed phrases) - - [x] [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) (Key generation prefixes) - - [x] [EIP-20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) (A standard interface for tokens - ERC-20) - - [x] [EIP-67](https://github.com/ethereum/EIPs/issues/67) (Standard URI scheme with metadata, value and byte code) - - [x] [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) (Replay attacks protection) *enforced!* - - [x] [EIP-681](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-681.md) (A standard way of representing various transactions, especially payment requests in Ethers and ERC-20 tokens as URLs) - - [x] [EIP-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) (A standard interface for non-fungible tokens, also known as deeds - ERC-721) - - [x] [EIP-165](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md) (Standard Interface Detection, also known as ERC-165) - - [x] [EIP-777](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-777.md) (New Advanced Token Standard, also known as ERC-777) - - [x] [EIP-820](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-820.md) (Pseudo-introspection Registry Contract, also known as ERC-820) - - [x] [EIP-888](https://github.com/ethereum/EIPs/issues/888) (MultiDimensional Token Standard, also known as ERC-888) - - [x] [EIP-1400](https://github.com/ethereum/EIPs/issues/1411) (Security Token Standard, also known as ERC-1400) - - [x] [EIP-1410](https://github.com/ethereum/EIPs/issues/1410) (Partially Fungible Token Standard, also known as ERC-1410) - - [x] [EIP-1594](https://github.com/ethereum/EIPs/issues/1594) (Core Security Token Standard, also known as ERC-1594) - - [x] [EIP-1643](https://github.com/ethereum/EIPs/issues/1643) (Document Management Standard, also known as ERC-1643) - - [x] [EIP-1644](https://github.com/ethereum/EIPs/issues/1644) (Controller Token Operation Standard, also known as ERC-1644) - - [x] [EIP-1633](https://github.com/ethereum/EIPs/issues/1634) (Re-Fungible Token, also known as ERC-1633) - - [x] [EIP-721x](https://github.com/loomnetwork/erc721x) (An extension of ERC721 that adds support for multi-fungible tokens and batch transfers, while being fully backward-compatible, also known as ERC-721x) - - [x] [EIP-1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md) (Multi Token Standard, also known as ERC-1155) - - [x] [EIP-1376](https://github.com/ethereum/EIPs/issues/1376) (Service-Friendly Token, also known as ERC-1376) - - [x] [ST-20](https://github.com/PolymathNetwork/polymath-core) - ST-20 token is an Ethereum-based token implemented on top of the ERC-20 protocol that adds the ability for tokens to control transfers based on specific rules + - [x] [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD Wallets: Deterministic Wallet + - [x] [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) (Seed phrases) + - [x] [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) (Key generation prefixes) + - [x] [EIP-20](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md) (A standard interface for tokens - ERC-20) + - [x] [EIP-67](https://github.com/ethereum/EIPs/issues/67) (Standard URI scheme with metadata, value and byte code) + - [x] [EIP-155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md) (Replay attacks protection) *enforced!* + - [x] [EIP-681](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-681.md) (A standard way of representing various transactions, especially payment requests in Ethers and ERC-20 tokens as URLs) + - [x] [EIP-721](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md) (A standard interface for non-fungible tokens, also known as deeds - ERC-721) + - [x] [EIP-165](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md) (Standard Interface Detection, also known as ERC-165) + - [x] [EIP-777](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-777.md) (New Advanced Token Standard, also known as ERC-777) + - [x] [EIP-820](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-820.md) (Pseudo-introspection Registry Contract, also known as ERC-820) + - [x] [EIP-888](https://github.com/ethereum/EIPs/issues/888) (MultiDimensional Token Standard, also known as ERC-888) + - [x] [EIP-1400](https://github.com/ethereum/EIPs/issues/1411) (Security Token Standard, also known as ERC-1400) + - [x] [EIP-1410](https://github.com/ethereum/EIPs/issues/1410) (Partially Fungible Token Standard, also known as ERC-1410) + - [x] [EIP-1594](https://github.com/ethereum/EIPs/issues/1594) (Core Security Token Standard, also known as ERC-1594) + - [x] [EIP-1643](https://github.com/ethereum/EIPs/issues/1643) (Document Management Standard, also known as ERC-1643) + - [x] [EIP-1644](https://github.com/ethereum/EIPs/issues/1644) (Controller Token Operation Standard, also known as ERC-1644) + - [x] [EIP-1633](https://github.com/ethereum/EIPs/issues/1634) (Re-Fungible Token, also known as ERC-1633) + - [x] [EIP-721x](https://github.com/loomnetwork/erc721x) (An extension of ERC721 that adds support for multi-fungible tokens and batch transfers, while being fully backward-compatible, also known as ERC-721x) + - [x] [EIP-1155](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md) (Multi Token Standard, also known as ERC-1155) + - [x] [EIP-1376](https://github.com/ethereum/EIPs/issues/1376) (Service-Friendly Token, also known as ERC-1376) + - [x] [ST-20](https://github.com/PolymathNetwork/polymath-core) - ST-20 token is an Ethereum-based token implemented on top of the ERC-20 protocol that adds the ability for tokens to control transfers based on specific rules - [x] RLP encoding - [x] Batched requests in concurrent mode @@ -176,7 +176,7 @@ Add the following line to the Cartfile and save it: github "matter-labs/web3swift" "master" ``` -Run `carthage update` to build the framework. By default, Carthage performs checkouts and builds in a new directory 'Carthage' in the same location as your Cartfile. Open this directory, go to 'Build' directory, choose iOS or macOS directory and use framework from chosen directory in your Xcode project. +Run `carthage update` to build the framework. By default, Carthage performs checkouts and builds in a new directory 'Carthage' in the same location as your Cartfile. Open this directory, go to 'Build' directory, choose iOS or macOS directory and use the framework from the chosen directory in your Xcode project. --- @@ -184,7 +184,7 @@ Run `carthage update` to build the framework. By default, Carthage performs chec Full source please look at [Documentation folder](https://github.com/matter-labs/web3swift/blob/master/Documentation/) -Here is quick references for basic features: +Here are quick references for basic features: - [Preffered models](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#preffered-models) - [Preffered keys Wallet Model (Account)](https://github.com/matter-labs/web3swift/blob/master/Documentation/Usage.md#preffered-keys-wallet-model-account) @@ -247,13 +247,13 @@ You can try lib by running the example project: ## Popular questions -#### Is it possible to get Mnemonic Phrase (Seed Phrase) from Private key using web3swift? +#### Is it possible to get a Mnemonic Phrase (Seed Phrase) from Private key using web3swift? In web3swift there is no backward conversion from Private key to Mnemonic Phrase. Also it is theoretically impossible to recover a phrase from a Private key. After Seed Phrase is converted to some initial entropy the “master key is derived” and the initial entropy is discarded. The simplest solution is to encrypt the phrase using users pincode and save it in some other secure keystore. Mnemonic Phrase is very sensitive data and you must be very careful to let the user get it. -Our advise if you want to show it to user - ask to save a Passphrase when creating BIP32Keystore. +Our advise if you want to show it to a user - ask to save a Passphrase when creating BIP32Keystore. #### How to interact with custom smart-contract with web3swift?