Bitcoin Forum
May 14, 2024, 09:20:39 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: C# mining app project  (Read 176 times)
Sokander (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 1


View Profile
January 30, 2022, 09:33:06 AM
Merited by Welsh (1)
 #1

Hello,

I would like to start programming for mining app but clearly have no idea how to start it, so I am searching for working open source miners.

Do you know if https://github.com/ma261065/DotNetStratumMiner is working, else with what pools, I have tried a number of them but they do show no Hash rate after I run the miner (I have like 3 Khash).

https://trustpool.cc/
https://aikapool.com/doge/
https://www.viabtc.com/

Is this miner not compatible with those pools or I am missing something.
1715678439
Hero Member
*
Offline Offline

Posts: 1715678439

View Profile Personal Message (Offline)

Ignore
1715678439
Reply with quote  #2

1715678439
Report to moderator
1715678439
Hero Member
*
Offline Offline

Posts: 1715678439

View Profile Personal Message (Offline)

Ignore
1715678439
Reply with quote  #2

1715678439
Report to moderator
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715678439
Hero Member
*
Offline Offline

Posts: 1715678439

View Profile Personal Message (Offline)

Ignore
1715678439
Reply with quote  #2

1715678439
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10561



View Profile
January 30, 2022, 09:51:09 AM
Merited by ABCbits (1)
 #2

they do show no Hash rate after I run the miner (I have like 3 Khash).
Bitcoin's total hashrate is currently around 180 EHS (that is 1018), so your 3*103h/s is so little in comparison that the pools you connect to consider it to be nothing.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Sokander (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 1


View Profile
January 30, 2022, 10:05:07 AM
Last edit: January 30, 2022, 10:27:36 AM by Sokander
 #3

they do show no Hash rate after I run the miner (I have like 3 Khash).
Bitcoin's total hashrate is currently around 180 EHS (that is 1018), so your 3*103h/s is so little in comparison that the pools you connect to consider it to be nothing.

I see and it's confirming a reaction I had telling those mining pools are for ASIC, not GPU nor CPU, so is there any mining pools that is fit for GPU/CPU hash power ?

Edit: I am trying https://minexmr.com/
funsponge
Hero Member
*****
Offline Offline

Activity: 776
Merit: 557


View Profile
January 30, 2022, 11:56:26 AM
 #4

they do show no Hash rate after I run the miner (I have like 3 Khash).
Bitcoin's total hashrate is currently around 180 EHS (that is 1018), so your 3*103h/s is so little in comparison that the pools you connect to consider it to be nothing.

I see and it's confirming a reaction I had telling those mining pools are for ASIC, not GPU nor CPU, so is there any mining pools that is fit for GPU/CPU hash power ?

Edit: I am trying https://minexmr.com/
For Bitcoin? No GPU/CPU became useless many years ago. If you want to mine Bitcoin you will need to invest into a dedicated bitcoin miner. Before doing that be sure that you can afford the electricity costs

If you do not understand mining why are you developing a app for it? knowledge is needed to create a app for something
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5829


not your keys, not your coins!


View Profile WWW
January 30, 2022, 12:07:00 PM
 #5

they do show no Hash rate after I run the miner (I have like 3 Khash).
Bitcoin's total hashrate is currently around 180 EHS (that is 1018), so your 3*103h/s is so little in comparison that the pools you connect to consider it to be nothing.

I see and it's confirming a reaction I had telling those mining pools are for ASIC, not GPU nor CPU, so is there any mining pools that is fit for GPU/CPU hash power ?

Edit: I am trying https://minexmr.com/
That's a Monero Mining Pool (large because it's just as large on their website). It's a totally different cryptocurrency; so for one, that belongs into the Altcoin section.
Furthermore, any CPU mining software for Bitcoin won't work with it since the algorithms are completely different.
They do have an open source miner available. Here you can learn about getting started and here is the software for it. It's 95% C and C++ code already, so you'd be trying to rewrite it in a different way somehow (I don't get the point of doing so). You would also need to first learn how Monero works, if your understanding so far only covers Bitcoin.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Sokander (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 1


View Profile
January 30, 2022, 12:18:16 PM
 #6

Aight, I forgot bitcoin and seek for altcoins https://coinwut.com/mining-pool-single-gpu/
And I will ask a mod to migrate to altcoin section.

Else I am actually studying https://en.bitcoinwiki.org/wiki/Stratum_mining_protocol actually, there is such stuff in the source code I am reading.


For Bitcoin? No GPU/CPU became useless many years ago. If you want to mine Bitcoin you will need to invest into a dedicated bitcoin miner. Before doing that be sure that you can afford the electricity costs

If you do not understand mining why are you developing a app for it? knowledge is needed to create a app for something

I always learn stuff that way lole
funsponge
Hero Member
*****
Offline Offline

Activity: 776
Merit: 557


View Profile
January 30, 2022, 12:30:41 PM
 #7

I always learn stuff that way lole
I respect that! I thought it was going to be released to the public and not used to learn my bad.

Aight, I forgot bitcoin and seek for altcoins https://coinwut.com/mining-pool-single-gpu/
And I will ask a mod to migrate to altcoin section.
Use the report to moderator button
Sokander (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 1


View Profile
January 30, 2022, 03:46:12 PM
Last edit: January 30, 2022, 04:29:20 PM by Sokander
 #8

Finally I found a mining pool that is accepting DotNetStratumMiner, it's https://doge.mininghub.eu/index.php  Cool Cool
JayDDee
Full Member
***
Offline Offline

Activity: 1390
Merit: 220


View Profile
January 30, 2022, 05:48:42 PM
 #9

That program can only mine scrypt and uses a library for the POW code so you can't see it. The only thing you can
learn from it is how to do stratum with C#. The heart of any miner is the POW algorithm and there are hundreds
of different ones.

If this is about learning C# there are better ways, if it's about learning mining SW there are also better ways.
Don't try to do both. All good mining SW is written in c/c++, there's no benefit rewriting everything in C#.

Sokander (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 1


View Profile
January 30, 2022, 07:07:48 PM
 #10

That program can only mine scrypt and uses a library for the POW code so you can't see it. The only thing you can
learn from it is how to do stratum with C#. The heart of any miner is the POW algorithm and there are hundreds
of different ones.

If this is about learning C# there are better ways, if it's about learning mining SW there are also better ways.
Don't try to do both. All good mining SW is written in c/c++, there's no benefit rewriting everything in C#.

I want to do it in C# because it's my main language I do everything with and I do love WPF  Cool

Indeed, I have hit a function that target the dll that come with the source, thus I will try to merge https://github.com/lithander/Minimal-Bitcoin-Miner that do not rely on third party dll, with DotNetStratumMiner
JayDDee
Full Member
***
Offline Offline

Activity: 1390
Merit: 220


View Profile
January 30, 2022, 08:09:50 PM
 #11

I want to do it in C# because it's my main language I do everything with and I do love WPF  Cool

It's your choice but you'll have to learn c anyway to port the algos to c#. And don't use scrypt, it's
no longer viable for CPU mining. Choose a CPU mineable algo.

Sokander (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 1


View Profile
January 31, 2022, 01:48:30 PM
Last edit: January 31, 2022, 02:10:26 PM by Sokander
 #12

I want to do it in C# because it's my main language I do everything with and I do love WPF  Cool

It's your choice but you'll have to learn c anyway to port the algos to c#. And don't use scrypt, it's
no longer viable for CPU mining. Choose a CPU mineable algo.

Is there a simple algorithm to understand ?

I do not understand what this code is trying to do, what does meet the target means.

Code:
// Reference: https://github.com/replicon/Replicon.Cryptography.SCrypt
public void doScrypt(Byte[] Tempdata, Byte[] Target, uint Nonce, uint Increment)
{
    var StartTime = DateTime.Now;
    var Hashcount = 0.0;
    var Databyte  = new Byte[80];

    Array.Copy(Tempdata, 0, Databyte, 0, 76);

    // Loop until done is set or we meet the target
    while (!done)
    {
        Databyte[76] = (Byte)(Nonce >> 0);
        Databyte[77] = (Byte)(Nonce >> 8);
        Databyte[78] = (Byte)(Nonce >> 16);
        Databyte[79] = (Byte)(Nonce >> 24);

        var ScryptResult = Replicon.Cryptography.SCrypt.SCrypt.DeriveKey(Databyte, Databyte, 1024, 1, 1, 32);

        Hashcount++;

        if (meetsTarget(ScryptResult, Target))  // Did we meet the target?
        {
            if (!done)
            {
                FinalNonce = Nonce;
            }

            done = true;

            break;
        }
        else
        {
            Nonce += Increment; // If not, increment the nonce and try again
        }
    }

    var Elapsedtime = (DateTime.Now - StartTime).TotalMilliseconds;
    Console.WriteLine("Thread finished - {0:0} hashes in {1:0.00} ms. Speed: {2:0.00} kHash/s", Hashcount, Elapsedtime, Hashcount / Elapsedtime);
}

Code:
public bool meetsTarget(Byte[] Hash, Byte[] Target)
{
    for (var Index = Hash.Length - 1; Index >= 0; Index--)
    {
        var ItemA = Hash[Index]   & 0xFF;
        var ItemB = Target[Index] & 0xFF;

        if (ItemA > ItemB)
        {
            return false;
        }
        else if (ItemA < ItemB)
        {
            return true;
        }
    }

    return false;
}
JayDDee
Full Member
***
Offline Offline

Activity: 1390
Merit: 220


View Profile
January 31, 2022, 02:25:21 PM
 #13

Is there a simple algorithm to understand ?
I do not understand what this code is trying to do, what does meet the target means.

No. That's not even the POW algo, just the loop that calls it and tests the result.

This is the algo:

Code:
var ScryptResult = Replicon.Cryptography.SCrypt.SCrypt.DeriveKey(Databyte, Databyte, 1024, 1, 1, 32);

If you don't know what the target means you have a very long way to go.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!