You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kernel: can't load blocks from a custom signet #35362
libbitcoinkernel public api define btck_ChainType as a single byte. As such, there's no way to inform the signetchallenge parameters so that the resulting btck_ChainstateManager can work with signets other than the "public" one.
Also, as far as I can understand, none of the functions exported in the public API can be used to achieve such a result. This information comes from ArgsMann in the node, which is abstracted away in the kernel library.
I wonder what would be the best approach to solve this. Maybe a richer btck_ChainType capable of carrying more information.
Found this with @oleonardolima during a @vinteumorg bitcoinkernel study session. We were trying to load this datadir, a custom chain we use in the educational programs.
Reacted by leonardo, Johnny Santos, Vinicius Cestari and Joao Leal
I wonder what would be the best approach to solve this.
The CChainParams::SigNet factory method takes an optional SigNetOptions struct, so it should be fairly straightforward to add an optional signet_challenge parameter to btck_chain_parameters_create?
so it should be fairly straightforward to add an optional signet_challenge parameter to btck_chain_parameters_create
I'm not sure about adding a paramter, seems like that could get very crowded and confusing quickly. I was working on solving this issue on the weekend: sedited@e79d107 , but then saw darosior's #35335, which adds dedicated methods for every network. So maybe we can keep the btck_chain_parameters_create function as is, and just add new functions for every available network with their respective options.
So maybe we can keep the btck_chain_parameters_create function as is, and just add new functions for every available network with their respective options.
I think this would be a better design overall. That way the api will resemble more a builder pattern: you create a default btck_ChainParameters with btck_chain_parameters_create() and have methods to modify/configure the opaque structure.
Activity
stickies-v commentedon May 27, 2026
The
CChainParams::SigNetfactory method takes an optionalSigNetOptionsstruct, so it should be fairly straightforward to add an optionalsignet_challengeparameter tobtck_chain_parameters_create?sedited commentedon May 27, 2026
I'm not sure about adding a paramter, seems like that could get very crowded and confusing quickly. I was working on solving this issue on the weekend: sedited@e79d107 , but then saw darosior's #35335, which adds dedicated methods for every network. So maybe we can keep the
btck_chain_parameters_createfunction as is, and just add new functions for every available network with their respective options.stickies-v commentedon May 27, 2026
You're right. And especially test-only options should minimally leak into the non-test interface.
So you mean something like
void btck_chain_parameters_set_signet_challenge(btck_ChainParameters* params, const char* challenge, size_t challenge_len)?edilmedeiros commentedon May 29, 2026
I think this would be a better design overall. That way the api will resemble more a builder pattern: you create a default
btck_ChainParameterswithbtck_chain_parameters_create()and have methods to modify/configure the opaque structure.Merge #35464: kernel: Add function for creating chainparams with a si…
Merge bitcoin/bitcoin#35464: kernel: Add function for creating chainp…
Merge bitcoin/bitcoin#35464: kernel: Add function for creating chainp…