horizontalsystems / bitcoin-kit-android

Comprehensive Bitcoin development library for Android, implemented on Kotlin. SPV wallet implementation for Bitcoin, Bitcoin Cash, Litecoin and Dash blockchains. Fully compliant with existing standards and BIPs.
https://unstoppable.money
MIT License
156 stars 68 forks source link

DIfferent address in transaction receipt when sending BTC #570

Open kambaroff opened 2 years ago

kambaroff commented 2 years ago

Why there is different address in transaction receipt? Using BIP84 type.

abdrasulov commented 2 years ago

Can you please share the details? The steps to reproduce it

kambaroff commented 2 years ago

There is not so much steps to reproduce, everything is as it usually would be done. We are using BIP84 on MainNet.

private val networkType = BitcoinKit.NetworkType.MainNet
private val syncMode = BitcoinCore.SyncMode.NewWallet()
private val bip = Bip.BIP84

bitcoinKit = BitcoinKit( App.instance, seedPhrase.split(" "), "", "Dexoo", networkType, syncMode = syncMode, bip = bip )

Every other functionality is just fine. But after transaction is sent from our wallet, the transaction receipt (blockhain.com, trustwallet) shows that is was sent from different address. Here is the method, nothing much to it:

`override suspend fun sendTransaction( amount: Double, address: String ): FullTransaction { val satoshis = (amount * 10.0.pow(8)).toLong()

    return bitcoinKit.send(
        address,
        satoshis,
        feeRate = feePriority.feeRate,
        sortType = TransactionDataSortType.Shuffle
    )
}`

Our goal here is to show address of sender consistently, so that user can confirm with the sender.