Giter Site home page Giter Site logo

trustwallet / wallet-core Goto Github PK

View Code? Open in Web Editor NEW
2.6K 131.0 1.5K 29.11 MB

Cross-platform, cross-blockchain wallet library.

Home Page: https://developer.trustwallet.com/wallet-core

License: Apache License 2.0

CMake 0.58% C 16.18% C++ 45.77% Java 0.02% Ruby 0.72% Kotlin 5.49% Shell 0.43% HTML 1.11% Swift 7.56% Objective-C 0.03% Python 0.33% Dockerfile 0.04% TypeScript 0.79% Rust 20.90% Handlebars 0.05%
blockchain cross-platform bitcoin ethereum crypto cryptocurrency

wallet-core's Introduction

Trust Wallet Core is an open-source, cross-platform, mobile-focused library implementing low-level cryptographic wallet functionality for a high number of blockchains. It is a core part of the popular Trust Wallet, and some other projects. Most of the code is C++ with a set of strict C interfaces, and idiomatic interfaces for supported languages: Swift for iOS and Java (Kotlin) for Android.

iOS CI Android CI Linux CI Rust CI Wasm CI Kotlin CI Docker CI Quality Gate Status

Gitpod Ready-to-Code GitHub GitHub release (latest by date) SPM Cocoapods

Documentation

For comprehensive documentation, see developer.trustwallet.com.

Audit Reports

Security Audit reports can be found in the audit directory.

Supported Blockchains

Wallet Core supports more than 130 blockchains: Bitcoin, Ethereum, BNB, Cosmos, Solana, and most major blockchain platforms. The full list is here.

Building

For build instructions, see developer.trustwallet.com/wallet-core/building.

Using from your project

If you want to use wallet core in your project follow these instructions.

Android

Android releases are hosted on GitHub packages, you need to add GitHub access token to install it. Please check out this installation guide or build.gradle from our android sample

Don't forget replacing the version in the code with latest: GitHub release (latest by date)

iOS

We currently support Swift Package Manager and CocoaPods (will discontinue in the future).

SPM

Download latest Package.swift from GitHub Releases and put it in a local WalletCore folder.

Add this line to the dependencies parameter in your Package.swift:

.package(name: "WalletCore", path: "../WalletCore"),

Or add remote url + master branch, it points to recent (not always latest) binary release.

.package(name: "WalletCore", url: "https://github.com/trustwallet/wallet-core", .branchItem("master")),

Then add libraries to target's dependencies:

.product(name: "WalletCore", package: "WalletCore"),
.product(name: "SwiftProtobuf", package: "WalletCore"),

CocoaPods

Add this line to your Podfile and run pod install:

pod 'TrustWalletCore'

NPM (beta)

npm install @trustwallet/wallet-core

Go (beta)

Please check out the Go integration sample.

Kotlin Multipleplatform (beta)

Please check out the Kotlin Multiplatform sample

Projects

Projects using Trust Wallet Core. Add yours too!

Trust Wallet

Coinpaprika | crypto.com | Alice | Frontier | Tokenary | MemesWallet | xPortal | Slingshot

Community

There are a few community-maintained projects that extend Wallet Core to some additional platforms and languages. Note this is not an endorsement, please do your own research before using them:

Contributing

The best way to submit feedback and report bugs related to WalletCore is to open a GitHub issue. If the bug is not related to WalletCore but to the TrustWallet app, please create a Customer Support ticket. If you want to contribute code please see Contributing. If you want to add support for a new blockchain also see Adding Support for a New Blockchain, make sure you have read the requirements section.

Thanks to all the people who contribute.

Disclaimer

The Wallet Core project is led and managed by Trust Wallet with a large contributor community and actively used in several projects. Our goal at Wallet Core is to give other wallets an easy way to add chain support.

Trust Wallet products leverage wallet core, however, they may or may not leverage all the capabilities, features, and assets available in wallet core due to their own product requirements.

License

Trust Wallet Core is available under the Apache 2.0 license. See the LICENSE file for more info.

wallet-core's People

Contributors

alejandro-isaza avatar andreibancioiu avatar artemgoryunov avatar ayushbherwani1998 avatar bravoadam avatar bsathvik avatar criesofcarrots avatar dependabot[bot] avatar dstranz avatar eddywm avatar grachyov avatar hewigovens avatar johnnynanjiang avatar keefertaylor avatar kurotych avatar lamafab avatar leoneparise avatar madcake avatar maximpestryakov avatar milerius avatar miloserdow avatar optout21 avatar phuang avatar pirk avatar riptl avatar rsrbk avatar satoshiotomakan avatar vcoolish avatar vikmeup avatar w20089527 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wallet-core's Issues

Android crash

Latest trust-wallet-core, Android 6.0:

pid: 0, tid: 0 >>> com.wallet.crypto.trustapp <<<

backtrace:
  #00  pc 000000000006a7d8  /system/lib64/libc.so (tgkill+8)
  #01  pc 00000000000680b8  /system/lib64/libc.so (pthread_kill+68)
  #02  pc 0000000000023a38  /system/lib64/libc.so (raise+28)
  #03  pc 000000000001e1d8  /system/lib64/libc.so (abort+60)
  #04  pc 0000000000433298  /system/lib64/libart.so (_ZN3art7Runtime5AbortEv+324)
  #05  pc 0000000000138004  /system/lib64/libart.so (_ZN3art10LogMessageD2Ev+3136)
  #06  pc 000000000030fe64  /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+2284)
  #07  pc 0000000000310430  /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+224)
  #08  pc 000000000034c5e0  /system/lib64/libart.so (_ZN3art3JNI22CallStaticObjectMethodEP7_JNIEnvP7_jclassP10_jmethodIDz+736)
  #09  pc 00000000001656ac  /data/app/com.wallet.crypto.trustapp-2/lib/arm64/libTrustWalletCore.so (Java_com_wallet_crypto_trustapp_jni_BitcoinTransactionSigner_sign+204)
  #10  pc 0000000001f6112c  /data/app/com.wallet.crypto.trustapp-2/oat/arm64/base.odex

Add support for NEO

Name: NEO
HD Derivation Scheme: BIP44 Coin / 888
Symbol: NEO
Documentation: NEO

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests for Address. Put them in a subfolder of tests/.
  • Write unit tests for Transaction/Signer. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects.
  • Write integration tests for each.

Add support for Tezos

Name: Tezos
HD Derivation Scheme: BIP44 Coin / 1729
Symbol: XTZ

Checklist

  • Coin configuration
    • coin type / decimals
    • recommended tx block explorer (example)
  • Account / Address
    • derived from bip39 phrases
    • from public key / string
    • validation
  • Transaction
    • serialization
    • signing
  • C interfaces
    • Validate generated code in Android and iOS projects
  • Tests
    • Unit test
    • integration test ( Java / Swift)

Generate network models

Swift VechainBalance.swift:

import Foundation

struct VechainBalance: Codable {
    let balance: String
    let energy: String
}

Android VechainBalance.kt:

package com.wallet.crypto.trustapp.entity

data class VechainBalance(val balance: String, val energy: String)

Different keys:

struct TronBlock: Codable {
    let blockHeader: BlockRawData

    private enum CodingKeys: String, CodingKey {
        case blockHeader = "block_header"
    }
}
data class TronBlock(
        @SerializedName("block_header") val blockHeader: BlockRawData)

Ethereum signer works wrong

Steps to Reproduce (for bugs)

Result for ETH signer RLP.encode(transaction.sign) from the trust-core doesn't equal to
EthereumSigner.sign.encoded from the wallet-core.

Add support for I/O Coin

Name: I/O Coin

HD Derivation Scheme:

Symbol: IOC

Documentation: IOC

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects. Write integration tests for each.

Zcash Address validation tests

TEST(ZcashAddress, isValid) {
    string zcashAddress_0 = "t3WeKQDxCijL5X7rwFem1MTL9ZwVJkUFhpF";
    string zcashAddress_1 = "t1aQ1JEFMqciA58XU6CR8CNohAYzESm8c1L";
    string bitcoinAddress = "1Ma2DrB78K7jmAwaomqZNRMCvgQrNjE2QC";

    ASSERT_TRUE(TAddress::isValid(zcashAddress_0));
    ASSERT_TRUE(TAddress::isValid(zcashAddress_1));
    ASSERT_FALSE(TAddress::isValid(bitcoinAddress));
}

Keystore Account Storage format

Account based

{
  "address": "0xe99494379c1d48aa73454c251a6395fdd4f9eb43",
  "derivationPath": "0/0/0"
}

UTXO based

A number of accounts will be always 1. It will contain either 0 index or the next change address index

[
   {
      "address":"0xe99494379c1d48aa73454c251a6395fdd4f9eb43",
      "derivationPath":"0/0/12",
      "extendedPublicKey":"123456"
   }
]

Account based as EOS/IOST

[
   {
      "account":"MyAccountName",
      "permissions": [
           {
               "key": "1234", 
               "access": "owner",
           }
          {
               "key": "1234", 
               "access": "active",
           }
       ]
   }
]

Add support for Decred

Description

Name: Drecred
HD Derivation Scheme: BIP44
Symbol: DCR
Documentation: https://docs.decred.org/advanced

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects. Write integration tests for each.

C++ linter

Add a C++ lint tool and report problem in CI.

JNI codegen issue for RippleSigner.sign() wrong return data type which doesn't exist

RippleSigner.sign() throws a JNI error.

JNI DETECTED ERROR IN APPLICATION: JNI GetStaticMethodID called with pending exception java.lang.ClassNotFoundException: Didn't find class "wallet.core.jni.proto.Proto$SigningOutput" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/com.wallet.crypto.trustapp.test-yhNuLZQpu5n6m7Q_gQfoKQ==/base.apk", zip file "/data/app/com.wallet.crypto.trustapp-k9nRS0JYYCFBUHJ1VngIGA==/base.apk"],nativeLibraryDirectories=[/data/app/com.wallet.crypto.trustapp.test-yhNuLZQpu5n6m7Q_gQfoKQ==/lib/x86, /data/app/com.wallet.crypto.trustapp-k9nRS0JYYCFBUHJ1VngIGA==/lib/x86, /data/app/com.wallet.crypto.trustapp.test-yhNuLZQpu5n6m7Q_gQfoKQ==/base.apk!/lib/x86, /data/app/com.wallet.crypto.trustapp-k9nRS0JYYCFBUHJ1VngIGA==/base.apk!/lib/x86, /system/lib]]
2019-03-04 10:56:29.522 11829-11862/com.wallet.crypto.trustapp A/crypto.trustap: java_vm_ext.cc:542] at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:134)
2019-03-04 10:56:29.522 11829-11862/com.wallet.crypto.trustapp A/crypto.trustap: java_vm_ext.cc:542] at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)

Fix Bitrise Android CI

Currently TrustCore Android CI fails on Bitrise, latest error:

Configuring standalone
CMake Error at CMakeLists.txt:78 (add_subdirectory):
  add_subdirectory given source "protobuf-plugin" which is not an existing
  directory.

Add support for Nimiq

Name: Nimiq
Symbol: NIM
Documentation: Protocol Reference

Checklist

  • Coin configuration
    • Coin Type / Decimals
    • Recommended Block Explorer (Nimiq.Watch)
    • Added to switch statements in src/interface/TWCoinType.cpp
  • Account / Address
    • From Private Key
    • From Public Key
    • From/To String (User-Friendly Address)
  • Transaction
    • Serialization
    • Signing
  • C interfaces
    • Validate generated code in Android and iOS projects
  • Tests
    • Unit Test
    • Integration Test
  • RPC endpoint

View progress here

Adding dependency to project

Cannot add the dependency to the project:

dependencies {
    compile 'com.trustwallet.walletcore:walletcore:0.4.0'
}

Got an error:
Failed to resolve: com.trustwallet.walletcore:trust-walletcore:0.4.0

Cannot really find the repository that contains it.

Crash on android when signing btc


*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.wallet.crypto.trustapp <<<

backtrace:
  #00  pc 0000000000021afc  /system/lib64/libc.so (abort+124)
  #01  pc 000000000046ad40  /system/lib64/libart.so (art::Runtime::Abort(char const*)+1208)
  #02  pc 0000000000008d2c  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+724)
  #03  pc 000000000049b070  /system/lib64/libart.so (art::Thread::AssertNoPendingException() const+1144)
  #04  pc 000000000011c658  /system/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, art::Handle<art::mirror::ClassLoader>)+64)
  #05  pc 0000000000136d84  /system/lib64/libart.so (art::ClassLinker::DoResolveType(art::dex::TypeIndex, art::Handle<art::mirror::DexCache>, art::Handle<art::mirror::ClassLoader>)+188)
  #06  pc 00000000004c59f8  /system/lib64/libart.so (art::verifier::MethodVerifier::ScanTryCatchBlocks()+496)
  #07  pc 00000000004c2bcc  /system/lib64/libart.so (art::verifier::MethodVerifier::Verify()+684)
  #08  pc 00000000004c54bc  /system/lib64/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc()+140)
  #09  pc 00000000004c53a4  /system/lib64/libart.so (art::verifier::MethodVerifier::FindLocksAtDexPc(art::ArtMethod*, unsigned int, std::__1::vector<art::verifier::MethodVerifier::DexLockInfo, std::__1::allocator<art::verifier::MethodVerifier::DexLockInfo>>*)+524)
  #10  pc 00000000003c4bf4  /system/lib64/libart.so (art::Monitor::VisitLocks(art::StackVisitor*, void (*)(art::mirror::Object*, void*), void*, bool)+812)
  #11  pc 00000000004a4714  /system/lib64/libart.so (art::MonitorObjectsStackVisitor::VisitFrame()+164)
  #12  pc 0000000000484418  /system/lib64/libart.so (_ZN3art12StackVisitor9WalkStackILNS0_16CountTransitionsE0EEEvb+1096)
  #13  pc 0000000000499e38  /system/lib64/libart.so (art::Thread::DumpJavaStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, bool) const+320)
  #14  pc 0000000000495e18  /system/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+376)
  #15  pc 00000000004afd9c  /system/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+844)
  #16  pc 00000000004a8ea4  /system/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+1444)
  #17  pc 00000000004a7f2c  /system/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+1036)
  #18  pc 000000000046aa10  /system/lib64/libart.so (art::Runtime::Abort(char const*)+392)
  #19  pc 0000000000008d2c  /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+724)
  #20  pc 00000000002e8898  /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1656)
  #21  pc 0000000000359db8  /system/lib64/libart.so (art::JNI::CallStaticObjectMethod(_JNIEnv*, _jclass*, _jmethodID*, ...)+1664)
  #22  pc 00000000001656ac  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/lib/arm64/libTrustWalletCore.so (Java_com_wallet_crypto_trustapp_jni_BitcoinTransactionSigner_sign+204)
  #23  pc 000000000016597c  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (com.kenai.jffi.Foreign.getArch [DEDUPED]+124)
  #24  pc 000000000055cb88  /system/lib64/libart.so (art_quick_invoke_stub+584)
  #25  pc 00000000000cf740  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
  #26  pc 00000000002823f0  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
  #27  pc 000000000027c3ac  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+948)
  #28  pc 000000000052f4a8  /system/lib64/libart.so (MterpInvokeVirtualQuick+584)
  #29  pc 0000000000552e94  /system/lib64/libart.so (ExecuteMterpImpl+29972)
  #30  pc 00000000004d1f50  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.vdex (trust.blockchain.bitcoin.BitcoinTransactionSigner.sign+734)
  #31  pc 0000000000255ea8  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1271626068+496)
  #32  pc 000000000025ba28  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
  #33  pc 000000000027c390  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
  #34  pc 000000000052d3d0  /system/lib64/libart.so (MterpInvokeInterface+1392)
  #35  pc 000000000054f314  /system/lib64/libart.so (ExecuteMterpImpl+14740)
  #36  pc 00000000004d5216  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.vdex (trust.blockchain.mnemonic.MnemonicAdapter.lambda$signTransaction$6+42)
  #37  pc 0000000000255ea8  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1271626068+496)
  #38  pc 000000000025ba28  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
  #39  pc 000000000027c390  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+920)
  #40  pc 000000000052d95c  /system/lib64/libart.so (MterpInvokeStatic+204)
  #41  pc 000000000054f294  /system/lib64/libart.so (ExecuteMterpImpl+14612)
  #42  pc 00000000004d4e9c  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.vdex (trust.blockchain.mnemonic.-$$Lambda$MnemonicAdapter$X-HQO0giO_Lo9ZJGYES4cZHd4Wo.apply+12)
  #43  pc 0000000000255ea8  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1271626068+496)
  #44  pc 000000000051cb98  /system/lib64/libart.so (artQuickToInterpreterBridge+1032)
  #45  pc 0000000000565cfc  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
  #46  pc 0000000000481ecc  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess+76)
  #47  pc 0000000000482044  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleMap$MapSingleObserver.onSuccess+452)
  #48  pc 00000000004f4d70  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual+800)
  #49  pc 0000000000475d78  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.Single.subscribe+312)
  #50  pc 00000000004f5118  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleMap.subscribeActual+168)
  #51  pc 0000000000475d78  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.Single.subscribe+312)
  #52  pc 00000000004f5118  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleMap.subscribeActual+168)
  #53  pc 0000000000475d78  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.Single.subscribe+312)
  #54  pc 0000000000481794  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleFlatMap$SingleFlatMapCallback.onSuccess+724)
  #55  pc 00000000004f4d70  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual+800)
  #56  pc 0000000000475d78  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.Single.subscribe+312)
  #57  pc 00000000004f48d8  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleFlatMap.subscribeActual+168)
  #58  pc 0000000000475d78  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.Single.subscribe+312)
  #59  pc 0000000000482858  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run+72)
  #60  pc 0000000000471b98  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.Scheduler$DisposeTask.run+104)
  #61  pc 000000000048498c  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.schedulers.ScheduledRunnable.run+108)
  #62  pc 0000000000484618  /data/app/com.wallet.crypto.trustapp-YhV4TkGoGgFOtXHSaLt82w==/oat/arm64/base.odex (io.reactivex.internal.schedulers.ScheduledRunnable.call+40)
  #63  pc 000000000036f8f8  /system/framework/arm64/boot.oat

Add support for Nano

Name: Nano
HD Derivation Scheme: BIP44/165
Symbol: NANO

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects. Write integration tests for each.

Support for Black Lion Coin, Waves Token

Expected Behavior

  1. Be able to add BlackLionCoin tokens into the wallet.

Context

We're trying to accomplish a simple process that our customers can buy our tokens and eventually exchange for Black Lion Coffees.

Add support for Zilliqa

Name: Zilliqa
HD Derivation Scheme: BIP44 / 313
Symbol: ZIL

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects. Write integration tests for each.

Android crash

Latest trust-wallet-core, Android 8

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.wallet.crypto.trustapp <<<

backtrace:
  #00  pc 000000000006b7d0  /system/lib64/libc.so (tgkill+8)
  #01  pc 000000000001df10  /system/lib64/libc.so (abort+88)
  #02  pc 0000000000437884  /system/lib64/libart.so (_ZN3art7Runtime5AbortEPKc+528)
  #03  pc 0000000000437f94  /system/lib64/libart.so (_ZN3art7Runtime7AborterEPKc+24)
  #04  pc 0000000000522e3c  /system/lib64/libart.so (_ZN7android4base10LogMessageD1Ev+900)
  #05  pc 00000000002d60b8  /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1716)
  #06  pc 00000000002d6384  /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortFEPKcS2_z+176)
  #07  pc 000000000033ad58  /system/lib64/libart.so (_ZN3art3JNI22CallStaticObjectMethodEP7_JNIEnvP7_jclassP10_jmethodIDz+1460)
  #08  pc 00000000001656ac  /data/app/com.wallet.crypto.trustapp-FodW8xDlPWgLM1W6sldTQw==/lib/arm64/libTrustWalletCore.so (Java_com_wallet_crypto_trustapp_jni_BitcoinTransactionSigner_sign+204)
  #09  pc 00000000006f40bc  /data/app/com.wallet.crypto.trustapp-FodW8xDlPWgLM1W6sldTQw==/oat/arm64/base.odex

Add support for Aion

Name: Aion
HD Derivation Scheme: BIP44 Coin / 425
Symbol: AION

Checklist

  • Coin configuration
    • coin type / decimals
    • recommended block explorer (example)
  • Account / Address
    • derived from bip39 phrases
    • from public key / string
    • validation
  • Transaction
    • serialization
    • signing
  • C interfaces
    • Validate generated code in Android and iOS projects
  • Tests
    • Unit test
    • integration test ( Java / Swift)

Consistent methods for signers

Currently to sign binance chain transaction we call BinanceSigner.init(input: signingInput).build() but the rest of the signers we just do:
RippleSigner.sign(input: signingInput), would it be possible to make it consistent?

Add support for Ontology

Description

Name: Ontology

HD Derivation Scheme: BIP44 / 1024

Symbol: ONT

Documentation: Ontology dev-docs

Reason:

  • Ontology is a new high-performance public blockchain project & a distributed trust collaboration platform.

  • Ontology provides new high-performance public blockchains that include a series of complete distributed ledgers and smart contract systems.

  • Ontology blockchain framework supports public blockchain systems and is able to customize different public blockchains for different applications. Ontology supports collaboration amongst chain networks with its various protocol groups.

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address
    • Derivation from private key in src/Coin.cpp.
      • Validation in src/Coin.cpp.
      • Coin configuration
      • Add coin type / decimals
      • Return correct curve and purpose in src/Coin.cpp.
    • Add coin type / decimals
    • Return correct curve and purpose in src/Coin.cpp.
    • Transaction
    • ParamsBuilder
    • Account
    • Asset
    • ONT
    • ONG
  • Write unit tests. Put them in a subfolder of tests/.
    • Address
    • Transaction
    • ParamsBuilder
    • Account
    • ONT
    • ONG
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in iOS projects.
    • A swift Ontology class inherited from Blockchain
    • Add a swift Ontology class inherited test case
    • Add a swift address test case
    • Add a swift ONT test case
    • Add a swift ONG test case

Generate swifty typealias

It looks like we can generate typealias like this:

typealias TWBitcoinSigningInput = TW_Bitcoin_Proto_SigningInput
typealias TWBitcoinUnspentTransaction = TW_Bitcoin_Proto_UnspentTransaction
typealias TWBitcoinTransactionPlan = TW_Bitcoin_Proto_TransactionPlan
typealias TWBitcoinOutPoint = TW_Bitcoin_Proto_OutPoint

We can remove TW prefix once we remove TrustCore's Bitcoin implementation

Add support for Bitshares

Description

Name: bitshares

HD Derivation Scheme:

Symbol: BTS

Documentation: bitshares

Reason: There are many blockchains built off of bitshares which would benefit from this support

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects. Write integration tests for each.

Add support for Monero

Name: Monero
HD Derivation Scheme: Custom
Symbol: XMR

Checklist

  • Implement functionality in C++. Put it in a subfolder of src/.
    • Address (if necessary)
    • Transaction (if necessary)
    • Signer
  • Write unit tests. Put them in a subfolder of tests/.
  • Add relevant constants in TWCoinType, TWP2SHPrefix, TWEthereymChainID, TWHRP, etc., as necessary.
  • Return correct curve and purpose in src/Coin.cpp.
  • Implement address validation and derivation in src/Coin.cpp.
  • Implement coin configuration src/include/TWCoinTypeConfiguration.cpp.
  • Write interface header in include/TrustWalletCore and implement the interface in src/interface.
    • Address interface (if necessary).
    • Signing interface.
  • Validate generated code in Android an iOS projects. Write integration tests for each.

Generate Xcode project

Currently updating the Xcode project is a manual process and some people don't have a Mac. We need to generate the project.

Add support for Ripple

Name: Ripple
HD Derivation Scheme: BIP44 / 144
Symbol: XRP

Reference:
Base58

Checklist

Linux CI

Use the Dockerfile to run tests on Linux for every PR.

Add support for

Description

Name:

HD Derivation Scheme:

Symbol:

Documentation:

Reason:

Checklist

  • Coin configuration
    • coin type / decimals
    • recommended tx block explorer
  • Address
    • derived from bip39 phrases
    • from public key / string
    • validation
  • Transaction
    • serialization
    • signing
  • C interfaces
    • Validate generated code in Android and iOS projects
  • Tests
    • Unit test
    • integration test ( Java / Swift)

[WIP] Define information for each coin

  1. chain ID
  2. Is this only coin, or there is also support for tokens on the blockchain?
  3. default network fee - in satoshis.
  4. Native Token name, aka ERC20, TRC10, or Default to symbol + 20

Add support for Stellar

Name: Stellar
HD Derivation Scheme: BIP44 Coin / 148
Symbol: XLM

Checklist

  • Coin configuration
    • coin type / decimals
  • Account / Address
    • derived from bip39 phrases
    • from public key / string
    • validation
  • Transaction
    • serialization
    • signing
  • C interfaces
    • Validate generated code in Android and iOS projects
  • Tests
    • Unit test
    • integration test ( Java / Swift)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.