What did you specify for the required
timestamp parameter of
importdescriptors? And, yes, did you do a rescan for your wallet from the earliest descriptor or from the Genesis block?
Occording to help description the
timestamp parameter specifies the "time from which to start rescanning the blockchain for this descriptor, in UNIX epoch time". With
0 (number zero) the rescan will be done for the entire blockchain, specifying
"now" bypasses rescanning and substitutes the current synced blockchain time. (Source:
bitcoin-cli help importdescriptors)
But as nc50lc said, once you rescanned the blockchain, existing transactions for the descriptors will have their transaction timestamp set to the block's header timestamp in which the transaction got confirmed.
I have done this for my watch-only wallets of
Patoshi blocks, importing about 21,954
combo() descriptors for the attributed public keys, setting labels as mined block number and using different timestamps for the descriptors in two different wallets. After a complete resync the transactions timestamps show no difference between the two wallets.
I have no issues to order the transaction history by confirmation time (sorted by Date column in Core's Transactions display).
Recent transactions actually have a timestamp when the transactions becomes known to the running node's mempool (see last
transaction with my local timestamp 11.03.26 05:00 (UTC+1) which actually got confirmed about 20min later in block 9402020).

Here are some older transactions:

listdescriptors false shows the same timestamp value for all addresses except the first one (first as in the order delivered by listdescriptors false output)
All I know is that I labeled the names of the transactions such as:
Testnet test 1
Testnet test 2
... etc
So basically, the wallet shows them in reverse order. If I have for instance 5 transactions:
Testnet test 5
Testnet test 4
... etc until 1
Now if I go to the watch-only wallet, I get this order:
Testnet test 5
" " 3
" " 4
" " 1
" " 2
So clearly it's not in the same order I sent them. Im not sure why it has chosen to show that order.
I am not sure about what you mentioned of rescanning, I will try later.
Now that you mentioned it; this can be a major factor if it's the case of his transactions actually having the same timestamps.
If most of his transactions are included in the same block and the watch-only descriptors are restored to a new setup, it'll have no idea of the mempool-based timestamp that the original wallet knows.
So, the dates (including time) will be the same for those same-block transactions.
This is a issue on Bitcoin Core, it happened to me when I imported addresses with transactions from 2018. 5 or 6 transactions had the same dates and times, even though they were actually received at different times, even days apart. However, years later, doing the same thing didn't happen again.
OP @takuma sato how are you importing addresses and xpubs with "importdescriptors"? Can you paste an example here?
What are you inserting in the "timestamp:" parameter? To avoid confusion, include "timestamp:"
now" in the importdescriptors command, wait for confirmation that the descriptors have been imported, and then use the command "rescanblockchain start_height stop_height". I always do it in this order and it has always worked as expected.
These same commands should probably work on Knots.
Relevant topics that may help:
https://bitcointalk.org/index.php?topic=5483885.0https://bitcointalk.org/index.php?topic=5498210.0https://developer.bitcoin.org/reference/rpc/rescanblockchain.htmlIm reading this again and I don't understand what you mean by ""timestamp:"
now" in the importdescriptors command,"
All I know is, like I said above, the order that the transactions show up are different on the watchonly. I did not enter any timestamps manually, I entered the output of "listdescriptors false" with "importdescriptors" and that is the result.
If you mean that I manually put "now" on all "timestamp" fields, that will take forever if you have many transactions. However, I just did that manually with the testnet wallet to see what happens, these are the results:
1) replaced the timestamp: "blockvalue" with "now" on all the fields
2) imported it with "importdescriptors"
Result: this error:
"Error: Error parsing JSON:"
It works if I leave the default timestamp values.
I ran "rescanblockchain", I didn't know what to put as values there, so I rescanned the entire blockchain, on the watch-only wallet to see if maybe it reordered that way, but nothing, the order is the same.
I believe the watch-only wallet has no idea how to order transactions if they are included on the same blockheight (I think "timestamp" value is a blockheight) and then as it sees a bunch of timestamps that were done in a row and included within the same block, it just adds them randomly or I don't know in which order.