Skip to content
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

fix: add coinbase txn id to improve auditability #204

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

iloveitaly
Copy link
Contributor

No description provided.

@@ -553,7 +553,8 @@ def _process_transfer(
)
elif transaction_type == _SEND:
transaction_network = transaction[_NETWORK]
crypto_hash: str = transaction_network[_HASH] if _HASH in transaction_network else Keyword.UNKNOWN.value
# although this transaction ID is not global, is improves adutibility in the reports
crypto_hash: str = transaction_network[_HASH] if _HASH in transaction_network else transaction[_ID]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately doing this is not advisable: using an internal Coinbase id as unique id of an external-facing transaction could confuse the transaction resolver and make it impossible to match the transaction. For external-facing transaction the only two values for unique id are UNKNOWN or the actual hash. For non-resolvable transactions it's OK to use an internal id (because they don't go through the transaction resolver). So I think the approach used in the original code is fine as it is: spell out what to use inside each if branch.

Finally note that for auditability purposes, all the JSON data from the Coinbase REST endpoint is captured in the debug log (including the Coinbase id), so if you needed to lookup a transaction by Coinbase id you could grep in the debug log.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can a user looking at the excel/odt docs understand what coinbase ID is referenced in a row/transaction?

That's what I'm trying to solve here

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best way is to grep the logs, which contain the full JSON. An alternative would be to add the id to the Notes field, but I don't favor this because it's not standardized (meaning that not all plugins do that), so it would be of limited use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants