-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal error wheh Coinbase makes 2 withdrawals in same tx #199
Comments
It seems that the original data (which I see as a |
Can you run with debug logs enabled? Logs are stored in the
Then open the log and look for occurrences of the unique_id: it should give us clues as to what is happening. If you can, post here the log entries with the problematic unique_id, however before posting here any personal data please read this and feel free to sanitize your logs to skip sensitive info. |
But both withdrawals are in the same Bitcoin transactions, therefore it's the same string value. |
I would need to see the logs to understand what is happening. Could you post the lines with the problematic unique id from the log? |
Here is the error details from the log:
|
Interesting: the two transactions have different ids (so they are treated by the Coinbase plugin as two different transactions) but the same hash/unique id (so the transaction resolver thinks they are two halves of the same transaction). I have a few follow-up questions:
Thanks. |
Right, it's two parts of the same transaction. Both are standard withdrawals to two different on-chain non-coinbase addresses. Just made with a single on-chain transaction, that's why they share the same hash. It was made with Coinbase Pro, but I don't use this plugin. It's available with Coinbase API, so it's the only plugin configured currently. |
I'm not sure I understand: how do you make two withdrawals to two different on-chain addresses using one single on-chain transaction (same hash) in Coinbase/Coinbase Pro? This sounds like functionality that is not implemented in the plugin (I wasn't even aware you could do it in CB). |
You don't need to do anything special. Just make a withdrawals via a standard Coinbase UI, then make another one in a minute or less. Most likely it will be the same outgoing transaction on-chain. Since Coinbase aggregates multiple withdrawals for different customers over a period of a few minutes into one transaction it also means that your multiple withdrawals comes to the same transaction as well. I mean, It's a standard functionality of Bitcoin protocol. if you look at any withdrawal from Coinbase, it's always multiple outputs. And the same is possible with Ethereum with new Coinbase withdrawal which now they make via a smart contract. |
I'm aware that BTC transactions can have multiple inputs and outputs at the protocol level, I just haven't seen it used in Coinbase / CBPro before (i.e. I haven't seen two outgoing CB transfers with the same hash before). We may have to add the output index to the transaction hash as the unique id: is that information available in the raw data? If you can paste the raw data for the two transactions (sanitized of personal info) we can start thinking on how to best solve this. |
I have multiple of them just in my withdrawal history. I guess an average person doesn't make a few withdrawals in a row, so it doesn't happen too often. Coinbase JSON doesn't include txout unfortunately. Most of the other fields could technically be same (like recipient address and amount). There is So the only fields that are unique in that JSON are |
If we don't have the index I'm not sure how to fix this: how can the transaction resolver know which of the two same-hash outgoing Coinbase transactions to map to each of the two destinations? The created_at field doesn't help because it doesn't carry information to tie together source and destination. I will think on this some more, but I don't see a simple solution to this issue. |
I thought some more about this issue and I want to summarize the problem and describe it precisely from the perspective of DaLI internals. Let's consider the example reported in this issue:
Now let's look at how DaLI sees the issue:
How could the issue be resolved? The problem is that some information is missing: if we had the output index together with the hash, on Coinbase Pro, on HWA and on HWB, we could use (hash, out index) as the unique id, instead of just hash. This would make the transaction resolver happy and we could fix the problem this way. But without this information how can the transaction resolver match source to destination? One idea: perhaps we could try to gather the missing information directly from the blockchain. |
Right, there is not transaction index and it doesn't seem to be possible to recover it in any way. Also, not only amounts but also the target address could be the same, so there is nothing to distinguish them. Btw, I think the fees should be considered as an equal amount in this case. Technically, it's the proportional part of the byte size for that particular output, and in this case only a type of address could affect it. I.e., different fees for P2PKH and P2SH. But economically, I think, Coinbase considers them as equal output splitting the fees proportionally. What I'm probably missing is why you don't want to use the |
Ah, the JSON actual has a field for the fee: |
The problem with |
When importing data from Coinbase REST API I have the following error:
The reason is that there are two different BTC withdrawals that were made through a single onchain transaction. I.e., both operations have the same transaction
hash
which is used asunique_id
, but differentto
addresses.The text was updated successfully, but these errors were encountered: