I want to write a program that gets a block header from the Litecoin client and increments the nonce until it finds a valid block. How do I do that?

C# is preferred however C, C++, python will do.

  • Could you be more specific? What functionality are you trying to access?
    – Nick ODell
    May 29, 2013 at 22:27
  • @NickODell well mining is the #1 thing but any other functionality would be a nice addition
    – David
    May 29, 2013 at 22:30
  • Have you look at this? It's C#, and supports getwork github.com/mb300sd/Bitcoin.NET
    – Nick ODell
    May 29, 2013 at 22:33
  • @NickODell Is it compatible with Litecoin, I've never been sure about whether BC clients work with LC
    – David
    May 29, 2013 at 22:36

1 Answer 1


I'm looking for a library that gives me mining functionality

I would suggest Bitcoin.NET. It can make an RPC connection to your Litecoin/Bitcoin client and ask for a block header to work on.

Is it compatible with Litecoin

Bitcoin and Litecoin share a lot of code, including Remote Procedure Call, which is what Bitcoin.NET uses to talk to your *coin client. Note that the RPC port for Litecoin is 9332 instead of 8332, though.

How do I write a mining client with this?

Take the block header getwork gives you and hash it like so. Compare it to your target.

  • I'm not sure how that fits into mining, I've looked over it and it doesn't seem to do more than let me talk Litecoin/Bitcoin
    – David
    May 29, 2013 at 23:11
  • Well I think there's still a lot left for me to do on this BUT I never turn down an educational challenge so this is probably what I'm needing
    – David
    May 29, 2013 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.