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

Place the output with the miner's address first in the coinbase tx #8099

Open
upbqdn opened this issue Dec 13, 2023 · 1 comment · May be fixed by #9272
Open

Place the output with the miner's address first in the coinbase tx #8099

upbqdn opened this issue Dec 13, 2023 · 1 comment · May be fixed by #9272
Assignees
Labels
A-rpc Area: Remote Procedure Call interfaces A-rust Area: Updates to Rust code C-bug Category: This is a bug I-privacy Zebra discloses private information

Comments

@upbqdn
Copy link
Member

upbqdn commented Dec 13, 2023

Motivation

When Zebra creates the coinbase tx, it places the output containing the miner's address last: https://testnet.zcashexplorer.app/transactions/ba0440859c79440692f49f6ac0630b692a01da4ed272f097ea2ea417ee41edd6, while zcashd does the opposite: https://testnet.zcashexplorer.app/transactions/63f30ccb9803e24c41cee97962d5dc029fa883a6ea4b7346a7ecea36285b7437. This behavior has at least two unwanted consequences:

  1. Block chain explorers, such as https://zcashexplorer.app/, seem to rely on the order when determining the miner of the block, so the explorer will display a dev fund recipient's address as the miner of the block.
  2. It is trivial to distinguish if a particular block was mined by Zebra or zcashd by looking at the placement of the output with the miner's address. It's straightforward to tell which output has the miner's address by looking at the transacted value.
@upbqdn upbqdn added C-bug Category: This is a bug A-rust Area: Updates to Rust code I-privacy Zebra discloses private information labels Dec 13, 2023
@mpguerra mpguerra added this to Zebra Dec 13, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Zebra Dec 13, 2023
@teor2345 teor2345 added the A-rpc Area: Remote Procedure Call interfaces label Dec 13, 2023
@teor2345
Copy link
Contributor

We already do sorting, maybe zcashd's behaviour has changed, or we got it wrong when we wrote it:

if like_zcashd {
// zcashd sorts outputs in serialized data order, excluding the length field
coinbase_outputs.sort_by_key(|(_amount, script)| script.clone());

@mpguerra mpguerra moved this from New to Sprint Backlog in Zebra Jan 22, 2025
@mpguerra mpguerra moved this from Sprint Backlog to Product Backlog in Zebra Jan 23, 2025
@mpguerra mpguerra moved this from Product Backlog to Sprint Backlog in Zebra Jan 23, 2025
@mpguerra mpguerra assigned upbqdn and unassigned upbqdn Jan 31, 2025
@oxarbitrage oxarbitrage linked a pull request Feb 18, 2025 that will close this issue
7 tasks
@mpguerra mpguerra moved this from Sprint Backlog to Review/QA in Zebra Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Area: Remote Procedure Call interfaces A-rust Area: Updates to Rust code C-bug Category: This is a bug I-privacy Zebra discloses private information
Projects
Status: Review/QA
Development

Successfully merging a pull request may close this issue.

4 participants