Skip to content

fix: add coinbase txn id to improve auditability#204

Open
iloveitaly wants to merge 2 commits intoeprbell:mainfrom
iloveitaly:transaction-id-on-coinbase
Open

fix: add coinbase txn id to improve auditability#204
iloveitaly wants to merge 2 commits intoeprbell:mainfrom
iloveitaly:transaction-id-on-coinbase

Conversation

@iloveitaly
Copy link
Copy Markdown
Contributor

No description provided.

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants