MetacoSA / NBitcoin

Comprehensive Bitcoin library for the .NET framework.
MIT License
1.87k stars 846 forks source link

Extract structural coin field to simpler interface #1137

Closed lontivero closed 1 year ago

lontivero commented 1 year ago

This PR creates a simpler ICoinable interface that contains only the structural elements that define a coin (prev_out, txout).

The reason behind this is that we are facing more and more need to abstract the concept of Coin but ICoin is not good enough for us because to implement it we need to implement things that makes no sense in our context.

Notice that across NBitcoin this new ICoinable is a better fit that ICoin in most of the places. I didn't do that change because, even when it wouldn't break backward compatibility, the idea here is to do the smallest possible change that help us to move forward. (anyway, let me know if you want me to do the change)