Skip to content

Enable SOLO mining mode on our Pool #135#269

Closed
therohityadav wants to merge 1 commit intostratum-mining:mainfrom
therohityadav:feature/enable-solo-mining
Closed

Enable SOLO mining mode on our Pool #135#269
therohityadav wants to merge 1 commit intostratum-mining:mainfrom
therohityadav:feature/enable-solo-mining

Conversation

@therohityadav
Copy link
Contributor

@therohityadav therohityadav commented Feb 13, 2026

Summary

Implemented the SOLO mining mode as requested in issue #135. This feature allows the pool to be toggled between standard and solo payout modes. When enabled, block rewards are redirected from the pool’s wallet to the Bitcoin address provided by the miner in the user_identity string.

Technical Breakdown

  • Configuration & State: Added the solo_mining boolean to PoolConfig and updated the ChannelManager to track this state.
  • Coinbase Logic: Modified mining_message_handler.rs to dynamically swap payout addresses in the coinbase transaction for both standard and extended mining channels.
  • Address Handling: Integrated assume_checked() when parsing miner addresses to resolve network-validation errors in the rust-bitcoin library.
  • Environment: Identified and resolved build-time dependency issues related to capnproto.

Verification

  • Successfully compiled in the pool crate.
  • Code formatted via cargo fmt.

Note: I am aware of the merge conflict shown in the UI and will rebase if required by the maintainers.

@average-gary
Copy link
Contributor

https://github.com/average-gary/sv2-apps/tree/feat/public-solo-mode
related experimentation branch.

}
}
} else {
self.coinbase_reward_script.script_pubkey().clone()
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this just be self for Channel manager? I would think you want per Channel address and not for the broader Pool Channel Manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wouldn't this just be self for Channel manager? I would think you want per Channel address and not for the broader Pool Channel Manager.

You are correct that for Solo Mining we need the per-channel address. That logic is handled in the if block immediately above this.

This specific line is inside the else block, which handles Standard Mining. In Standard mode, the coinbase reward must go to the Pool's global wallet (self.coinbase_reward_script) so the pool can collect the funds and distribute shares later.

@GitGab19
Copy link
Member

Can you resolve conflicts @therohityadav ?

@GitGab19 GitGab19 linked an issue Feb 16, 2026 that may be closed by this pull request
Copy link
Member

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

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

Can you add solo_mining parameter to Pool's config files?

Also, this PR still needs to check the solo mining mode in the handle_new_template and handle_set_new_prev_hash methods, since it's currently using the Pool's address there yet.

required_extensions,
monitoring_address: None,
monitoring_cache_refresh_secs: 15,
solo_mining: false,
Copy link
Member

Choose a reason for hiding this comment

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

Why did you set this to false here?

#[serde(default = "default_monitoring_cache_refresh_secs")]
monitoring_cache_refresh_secs: u64,
}

Copy link
Member

Choose a reason for hiding this comment

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

Remove this blank line.

Comment on lines +151 to +152
error!("SOLO Mining Error: Invalid address '{}' provided by user. Fallback to pool reward address.", user_identity);
self.coinbase_reward_script.script_pubkey().clone()
Copy link
Member

Choose a reason for hiding this comment

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

Here we should disconnect the the client, instead of doing fallback to pool's address.

Comment on lines +458 to +459
error!("SOLO Mining Error: Invalid address '{}' provided by user. Fallback to pool reward address.", user_identity);
self.coinbase_reward_script.script_pubkey().clone()
Copy link
Member

Choose a reason for hiding this comment

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

Here we should disconnect the the client, instead of doing fallback to pool's address.

@GitGab19
Copy link
Member

GitGab19 commented Mar 6, 2026

Closing in favor of #321

@GitGab19 GitGab19 closed this Mar 6, 2026
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.

Enable SOLO mining mode on our Pool

3 participants