Which are all address formats are supported for BTC transaction signing #1300
-
We are trying to perform transaction signing hash as per guides Link in android. But app crashes if we allow input with invalid addresses, so how do we validate the input addresses(recipient BTC address), which is supported by trustwallet. Is there an API in trust wallet to validate BTC addresses which are supported for transaction hash creation? We validated addresses which starts with bc1,1 and 3. But what about the p2pk and vanity address types. Does the trustwallet allows such address for bitcoin transaction signing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Which interface do you use to interface with wallet core? or here (this is BCH, but similar) |
Beta Was this translation helpful? Give feedback.
Which interface do you use to interface with wallet core?
The Address / AnyAddress API's can be used to validate an address.
See eg.:
https://github.com/trustwallet/wallet-core/blob/master/swift/Tests/CoinAddressDerivationTests.swift#L19
or here (this is BCH, but similar)
https://github.com/trustwallet/wallet-core/blob/master/swift/Tests/Blockchains/BitconCashTests.swift#L45