<blockquote>
  <p>I'm looking for a library that gives me mining functionality</p>
</blockquote>

<p>I would suggest <a href="https://github.com/mb300sd/Bitcoin.NET" rel="nofollow">Bitcoin.NET</a>. It can make an RPC connection to your Litecoin/Bitcoin client and ask for a block header to work on.</p>

<blockquote>
  <p>Is it compatible with Litecoin</p>
</blockquote>

<p>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.</p>

<blockquote>
  <p>How do I write a mining client with this?</p>
</blockquote>

<p>Take the block header <a href="https://en.bitcoin.it/wiki/Getwork" rel="nofollow">getwork</a> gives you and hash it <a href="https://github.com/litecoin-project/litecoin/wiki/Scrypt-proof-of-work" rel="nofollow">like so</a>. Compare it to your target.</p>

CC BY-SA 3.0
2013-05-29T23:11:55.437Z
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
CC BY-SA 3.0
2013-05-29T23:50:05.070Z
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
CC BY-SA 3.0
2013-05-29T23:02:51.587Z
2013-05-29T23:43:40.000Z
2013-05-29T23:43:40.000Z
Nick ODell
<p>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?</p>

<p>C# is preferred however C, C++, python will do.</p>

CC BY-SA 3.0
2013-05-29T22:27:56.733Z
Could you be more specific? What functionality are you trying to access?
Nick ODell
CC BY-SA 3.0
2013-05-29T22:30:26.677Z
@NickODell well mining is the #1 thing but any other functionality would be a nice addition
David
CC BY-SA 3.0
2013-05-29T22:33:14.787Z
Have you look at this? It's C#, and supports `getwork` https://github.com/mb300sd/Bitcoin.NET
Nick ODell
CC BY-SA 3.0
2013-05-29T22:36:24.727Z
@NickODell Is it compatible with Litecoin, I've never been sure about whether BC clients work with LC
David
<litecoin><development><mining-software>
How do I write a Litecoin mining client?
David
# How do I write a Litecoin mining client?

(Asked by: username_0 on 2013-05-29)

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.

**Tags:** litecoin, development, mining-software

> **Comments:**
> **username_1**: Could you be more specific? What functionality are you trying to access?  
> **username_0**: @username_1 well mining is the #1 thing but any other functionality would be a nice addition  
> **username_1**: Have you look at this? It's C#, and supports `getwork` https://github.com/mb300sd/Bitcoin.NET  
> **username_0**: @username_1 Is it compatible with Litecoin, I've never been sure about whether BC clients work with LC  

---

## 1 answers

### Answer by username_1 on 2013-05-29. Score: 2

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

I would suggest [Bitcoin.NET](https://github.com/mb300sd/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](https://en.bitcoin.it/wiki/Getwork) gives you and hash it [like so](https://github.com/litecoin-project/litecoin/wiki/Scrypt-proof-of-work). Compare it to your target.

> **Comments:**
> **username_0**: 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  
> **username_0**: 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  

---

