Remove Blockcore.Core dependency, migrate to pure NBitcoin#905
Open
DavidGershony wants to merge 2 commits into
Open
Remove Blockcore.Core dependency, migrate to pure NBitcoin#905DavidGershony wants to merge 2 commits into
DavidGershony wants to merge 2 commits into
Conversation
dangershony
reviewed
Jul 1, 2026
| @@ -0,0 +1,19 @@ | |||
| { | |||
| "permissions": { | |||
- Replace all Blockcore.NBitcoin.* and Blockcore.Consensus.* types with NBitcoin equivalents - Introduce AngorNetwork wrapper class to replace custom Blockcore network classes - Set TransactionBuilder.ShuffleOutputs=false and DustPrevention=false (NBitcoin defaults differ from Blockcore fork) - Retain Blockcore.Nostr.Client (provides Nostr.Client.* namespace, unrelated to Bitcoin) - Improve UAT deploy automation: detect errors early instead of waiting full TxTimeout - Delete 6 custom network classes (BitcoinMain, BitcoinSignet, BitcoinTest, BitcoinTest4, Angornet, LiquidMain) - Delete NetworkMapper.cs (replaced by AngorNetwork.BitcoinNetwork + implicit conversion)
a7999c2 to
3c1e6fc
Compare
dangershony
reviewed
Jul 4, 2026
| // find the spending script for the current secret hash combination | ||
|
|
||
| var hashes = secrets.Select(secret => (Blockcore.NBitcoin.Crypto.Hashes.Hash256(secret.ToBytes()), new Script(secret.ToBytes()))).ToList(); | ||
| var hashes = secrets.Select(secret => (Hashes.DoubleSHA256(secret.ToBytes()), new Script(secret.ToBytes()))).ToList(); |
Member
There was a problem hiding this comment.
is this confirmed to be correct?
dangershony
reviewed
Jul 4, 2026
| var taprootPubKey = new NBitcoin.TaprootPubKey(outputKeyBytes); | ||
| var address = taprootPubKey.GetAddress(NetworkMapper.Map(network)); | ||
| var taprootPubKey = new TaprootPubKey(outputKeyBytes); | ||
| var address = taprootPubKey.GetAddress(network.BitcoinNetwork); |
Member
There was a problem hiding this comment.
this is not clear to me, what is BitcoinNetwork? the current selected network?
…re-dependency # Conflicts: # src/shared/Angor.Shared/Protocol/InvestorTransactionActions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Blockcore.CoreNuGet package from all projects, replacing allBlockcore.NBitcoin.*andBlockcore.Consensus.*types with theirNBitcoin.*equivalentsAngorNetworkwrapper class (src/shared/Angor.Shared/Networks/AngorNetwork.cs) to replace Blockcore's custom network classesTransactionBuilder.ShuffleOutputs = falseandDustPrevention = falsein all productionBuildTransaction()paths (NBitcoin defaults differ from Blockcore's fork)Blockcore.Nostr.Clientpackage (providesNostr.Client.*namespace, unrelated to Bitcoin)Key Changes
Infrastructure:
AngorNetworkclass wrapsNBitcoin.Networkwith Angor-specific metadata (CoinType, IsMainnet, Name)NetworkMapper.cs— replaced byAngorNetwork.BitcoinNetworkproperty and implicit conversionType Migrations:
Blockcore.NBitcoin.*→NBitcoin.*(1:1 mapping)Blockcore.Consensus.TransactionInfo.*→NBitcoin.*Blockcore.Consensus.ScriptInfo.*→NBitcoin.*network.Consensus.CoinType→network.CoinTypeHashes.Hash256→Hashes.DoubleSHA256tx.ToHex(ConsensusFactory)→tx.ToHex()Critical behavioral differences handled:
TransactionBuilder.ShuffleOutputs = false— Blockcore didn't shuffle; NBitcoin does by defaultTransactionBuilder.DustPrevention = false— Angor protocol has sub-dust OP_RETURN outputsScript.ToOps()returnsIEnumerable<Op>in NBitcoin (vsIList<Op>in Blockcore) — added.ToList()where indexing is neededUAT automation improvement:
Testing
Not in scope