<p>I am trying to learn and understand more about mining software, and so I am trying to build a simple 1 to try it out. </p>

<p>I have been reading resources from <a href="https://slushpool.com/help/stratum-protocol#compatibility" rel="nofollow noreferrer">SlushPool</a> and a bit from the <a href="https://docs.google.com/document/d/17zHy1SUlhgtCMbypO8cHgpWH73V5iUQKk_0rWvMqSNs/edit?hl=en_US" rel="nofollow noreferrer">google link</a> they shared, and came up with a sample of the below code.</p>

<pre><code># The below code is in Python 3
import socket

host = 'rvn.suprnova.cc'
port = 6667

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((host, port))
    s.sendall(b'{"id": 1, "method": "mining.subscribe", "params": []}')
    data = s.recv(1024)

print(repr(data))
</code></pre>

<p>However, the response that I receive from the pool is:</p>

<pre><code>b'{"id":null,"method":"mining.notify","params":["8cbb","e5d5d839ee8654e963c2f685297cce8b34f8397ff7bb0ca900004c2100000000","01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2003c3c70a04240dda5c08","0d2f6e6f64655374726174756d2f00000000020000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90088526a740000001976a91481985dc4238eb976bffa1476119a71d511b88ae488ac00000000",[],"30000000","1a5efd7e","5cda0d24",false]}\n'
</code></pre>

<p>However, I noticed that this response is different from the response that i'm supposed to be receiving. I say this is because the response i should be receiving (according to SlushPool) should be:</p>

<pre><code>{"id": 1, "result": [ [ ["mining.set_difficulty", "b4b6693b72a50c7116db18d6497cac52"], ["mining.notify", "ae6812eb4cd7735a302a8a9dd95cf71f"]], "08000002", 4], "error": null}\n
</code></pre>

<p>I understand that the <code>id</code> will be different in the result.. But i'm not sure why is it that my response is not the <code>mining.subscribe</code> that I should be getting.</p>

<p>Any ideas? Thanks!</p>

CC BY-SA 4.0
2019-05-14T03:48:32.640Z
just a guess, but it might be waiting for you to submit some shares (to gauge your hashrate) before it sends you a difficulty.
JBaczuk
CC BY-SA 4.0
2019-05-14T04:07:07.340Z
@JBaczuk hmm. I don't think so? And the reason for that is because, I need to connect to the server first, which will provide me with some required details such as `Extranonce1 - Hex-encoded, per-connection unique string which will be used for coinbase serialization later. ` Then I can authorize workers with `mining.authorize` which will then return me a job. Am I mistaken?
jake wong
CC BY-SA 4.0
2019-05-14T04:39:15.490Z
well, you aren't connecting to slush pool, you're connecting to a ravencoin pool, so you can't be sure the docs are accurate.
JBaczuk
<mining-software>
Curious about building a mining software
jake wong
# Curious about building a mining software

(Asked by: username_0 on 2019-05-14)

I am trying to learn and understand more about mining software, and so I am trying to build a simple 1 to try it out.

I have been reading resources from [SlushPool](https://slushpool.com/help/stratum-protocol#compatibility) and a bit from the [google link](https://docs.google.com/document/d/17zHy1SUlhgtCMbypO8cHgpWH73V5iUQKk_0rWvMqSNs/edit?hl=en_US) they shared, and came up with a sample of the below code.

```
# The below code is in Python 3
import socket

host = 'rvn.suprnova.cc'
port = 6667

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((host, port))
    s.sendall(b'{"id": 1, "method": "mining.subscribe", "params": []}')
    data = s.recv(1024)

print(repr(data))

```

However, the response that I receive from the pool is:

```
b'{"id":null,"method":"mining.notify","params":["8cbb","e5d5d839ee8654e963c2f685297cce8b34f8397ff7bb0ca900004c2100000000","01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2003c3c70a04240dda5c08","0d2f6e6f64655374726174756d2f00000000020000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90088526a740000001976a91481985dc4238eb976bffa1476119a71d511b88ae488ac00000000",[],"30000000","1a5efd7e","5cda0d24",false]}\n'

```

However, I noticed that this response is different from the response that i'm supposed to be receiving. I say this is because the response i should be receiving (according to SlushPool) should be:

```
{"id": 1, "result": [ [ ["mining.set_difficulty", "b4b6693b72a50c7116db18d6497cac52"], ["mining.notify", "ae6812eb4cd7735a302a8a9dd95cf71f"]], "08000002", 4], "error": null}\n

```

I understand that the `id` will be different in the result.. But i'm not sure why is it that my response is not the `mining.subscribe` that I should be getting.

Any ideas? Thanks!

**Tags:** mining-software

> **Comments:**
> **username_1**: just a guess, but it might be waiting for you to submit some shares (to gauge your hashrate) before it sends you a difficulty.  
> **username_0**: @username_1 hmm. I don't think so? And the reason for that is because, I need to connect to the server first, which will provide me with some required details such as `Extranonce1 - Hex-encoded, per-connection unique string which will be used for coinbase serialization later. ` Then I can authorize workers with `mining.authorize` which will then return me a job. Am I mistaken?  
> **username_1**: well, you aren't connecting to slush pool, you're connecting to a ravencoin pool, so you can't be sure the docs are accurate.  

---

## 0 answers

