How do I write a Litecoin mining client?

-1

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.

David

Posted 2013-05-29T22:22:35.997

Reputation: 259

Could you be more specific? What functionality are you trying to access?Nick ODell 2013-05-29T22:27:56.733

@NickODell well mining is the #1 thing but any other functionality would be a nice additionDavid 2013-05-29T22:30:26.677

Have you look at this? It's C#, and supports getwork https://github.com/mb300sd/Bitcoin.NET

Nick ODell 2013-05-29T22:33:14.787

@NickODell Is it compatible with Litecoin, I've never been sure about whether BC clients work with LCDavid 2013-05-29T22:36:24.727

Answers

2

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.

Nick ODell

Posted 2013-05-29T22:22:35.997

Reputation: 26 536

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/BitcoinDavid 2013-05-29T23:11:55.437

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 needingDavid 2013-05-29T23:50:05.070