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

Add support for SmartCash #685

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 2 additions & 0 deletions NBitcoin.Altcoins/AltcoinNetworkSets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class AltNetworkSets
public static Bitcoinplus Bitcoinplus { get; } = Bitcoinplus.Instance;
public static Chaincoin Chaincoin { get; } = Chaincoin.Instance;
public static Stratis Stratis { get; } = Stratis.Instance;
public static SmartCash SmartCash { get; } = SmartCash.Instance;

public static IEnumerable<INetworkSet> GetAll()
{
Expand All @@ -57,6 +58,7 @@ public static IEnumerable<INetworkSet> GetAll()
yield return Koto;
yield return Bitcoinplus;
yield return Chaincoin;
yield return SmartCash;
}
}
}
1 change: 1 addition & 0 deletions NBitcoin.Altcoins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Currently supported altcoins are:
* Koto
* Bitcoinplus
* Chaincoin
* SmartCash

## How to use?

Expand Down
18 changes: 18 additions & 0 deletions NBitcoin.Altcoins/SmartCash.Internals/SmartCashKeccak.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NBitcoin.Altcoins.SmartCashInternals
{
public class SmartCashKeccak
{
public byte[] ComputeHash(byte[] input)
{
byte[] hashResult = input;
var keccak256 = HashX11.HashFactory.Crypto.SHA3.CreateKeccak256();
hashResult = keccak256.ComputeBytes(hashResult).GetBytes();
return hashResult.Take(32).ToArray();
}
}
}
Loading