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

feat: adaptation to btc signet #19

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

EthanYuan
Copy link
Collaborator

@EthanYuan EthanYuan commented Jun 7, 2024

The btc signet has its own special definition of difficulty consensus, such as powLimit, which is different from both maintain and testnet.

In order to support btc signet spv with spv type contract, this pr will be realized by extending flags. Flags is the u8 data at the end of the spv client cells args.

The expanded Flags are as follows:

// Constants for the chain type flag
// Specifically utilizing the two highest bits for chain type identification
pub const FLAG_CHAIN_TYPE_MAINNET: u8 = 0b0000_0000; // for mainnet
pub const FLAG_CHAIN_TYPE_TESTNET: u8 = 0b1000_0000; // for testnet
pub const FLAG_CHAIN_TYPE_SIGNET: u8 = 0b0100_0000; // for signet

Compatibility Notes:

  • For spv instance for testnet updated with this pr, spv service does not need to be upgraded.
  • But for spv instance for signet to be deployed and updated, service needs to be updated to support signet as well (new pr will be submitted to service later)

Another modification is that POW should be checked regardless of chain type. Checking POW is the most important security for spv client on chain.


@Flouse Flouse mentioned this pull request Jun 11, 2024
13 tasks
@Flouse Flouse requested a review from jjyr June 11, 2024 03:44
@EthanYuan EthanYuan added this pull request to the merge queue Jun 12, 2024
Merged via the queue into utxostack:master with commit bfc71d7 Jun 12, 2024
5 checks passed
@EthanYuan EthanYuan deleted the adaptation_to_signet branch June 12, 2024 05:03
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.

3 participants