monero-java icon indicating copy to clipboard operation
monero-java copied to clipboard

XMR 两个子地址之间的转账 在交易中如何解析出来??

Open miles-zhangdy opened this issue 3 years ago • 5 comments

这笔交易是一笔出金,接受地址和金额有办法解析出来么?谢谢!

miles-zhangdy avatar Nov 17 '21 03:11 miles-zhangdy

I'm sorry I'm not able to understand well.

After using createTx() to withdraw funds, you can get destination addresses and amounts like this:

MoneroTxWallet tx = wallet.createTx(...);
for (MoneroDestination : tx.getOutgoingTransfer().getDestinations()) { // destinations only available from local wallet data
  String address = destination.getAddress();
  BigInteger amount = destination.getAmount();
}

Note that destination amount and addresses are only available from local wallet data and are not recoverable from the blockchain.

woodser avatar Nov 17 '21 10:11 woodser

I'm sorry I'm not able to understand well.

After using createTx() to withdraw funds, you can get destination addresses and amounts like this:

MoneroTxWallet tx = wallet.createTx(...);
for (MoneroDestination : tx.getOutgoingTransfer().getDestinations()) { // destinations only available from local wallet data
  String address = destination.getAddress();
  BigInteger amount = destination.getAmount();
}

Note that destination amount and addresses are only available from local wallet data and are not recoverable from the blockchain.

在转出的时候没有解析该信息,即该交易广播上链之后,对于扫描区块交易的时候,就是扫描哪些是入金到平台钱包地址的,如何可以解析接收地址和金额。

另外一个问题:转出时 如果需要找零,那找零地址是每次使用一个新地址 还是找零到固定地址??

miles-zhangdy avatar Nov 18 '21 06:11 miles-zhangdy

The destination addresses and amounts are not recoverable from scanning the blockchain. This information is only stored with your local wallet file where you sent the transaction.

Change always goes to your wallet's primary address (account 0, subaddress 0). On the blockchain, this appears as a unique address since Monero always uses one-time addresses on the blockchain.

woodser avatar Nov 18 '21 13:11 woodser

The destination addresses and amounts are not recoverable from scanning the blockchain. This information is only stored with your local wallet file where you sent the transaction.

Change always goes to your wallet's primary address (account 0, subaddress 0). On the blockchain, this appears as a unique address since Monero always uses one-time addresses on the blockchain.

https://web.getmonero.org/resources/moneropedia/change.html

image I found a document, but it's different from what you said

miles-zhangdy avatar Nov 19 '21 02:11 miles-zhangdy

What is different from what I said? Change is always returned to the wallet's primary address.

woodser avatar Nov 19 '21 13:11 woodser

Closing as stale.

woodser avatar Mar 26 '24 15:03 woodser