MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.86k stars 844 forks source link

ScriptCoin and Coin cannot be Serialized #1221

Closed mathis1337 closed 1 month ago

mathis1337 commented 1 month ago

I was wanting to do some multisig and I have the method work, but I want to send the Coins to spend in a json payload for the other parties to sign and not use PSBT (I have reasons).

The issue is that ScriptCoin is cyclic and when trying to serialize I hit stack overflow problems.

Is there anyway to resolve this, or do I have to build some custom serializer? Same problem with Coin class.

Thanks.

lontivero commented 1 month ago

This isn't a problem in nbitcoin. All serializing libraries have at least one way to solve that problem.