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

Coinbase output script in pool conf not as easy as using address directly #1199

Open
rrybarczyk opened this issue Oct 10, 2024 · 4 comments
Open
Assignees
Labels
roles Pertains to all roles sv2 pool

Comments

@rrybarczyk
Copy link
Collaborator

Background

The roles::pool config toml accepts coinbase outputs by accepting a output_script_type and output_script_value. This output_script_value is the pool's compressed public key.

Problem

After speaking with @russeree, he mentioned it would be easier to support a coinbase address directly here. That on first look

Solution

Add support for a coinbase address in the pool config and logic.

@rrybarczyk rrybarczyk added sv2 pool roles Pertains to all roles labels Oct 10, 2024
@rrybarczyk
Copy link
Collaborator Author

Do we want to continue to support the output_script_value? I would say yes for now, and add the coinbase address as an additional alternative option. In the future, if we see that output_script_value is not used, then could consider deprecating.

@rrybarczyk rrybarczyk changed the title Use of output script in pool conf not as easy as using address directly Coinbase output script in pool conf not as easy as using address directly Oct 10, 2024
@GitGab19
Copy link
Collaborator

I agree it's a bit tricky to use what we have now 👍 It caused confusion also for some people who tried the benchmarking-tool, so we should work on it.
In the meantime, I would say that we have this crate to "easily" get the pubkey from a BIP32 xpub if it can help.

@russeree
Copy link

russeree commented Oct 10, 2024

I believe pubkey to address encoding is done here

https://github.com/stratum-mining/stratum/blob/main/protocols/v2/roles-logic-sv2/src/utils.rs#L191

Could we just use the rust bitcoin lib to fetch the address type? The use the helper functions to return the output script? This should let the user just place in an address and the process of getting the script from that would be handled.

Helpers that could be useful

If this is a reasonable path, I can pull this.

Edit:
I would assume preserving compatibility would be a part of this task.

@GitGab19
Copy link
Collaborator

Yes now the encoding is done there in the try_from.
Your approach looks good to me 👍

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

No branches or pull requests

3 participants