Bitcoin Forum
April 25, 2024, 06:43:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Ravencoin mining software development?  (Read 348 times)
NightEule5 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 17, 2018, 08:01:10 PM
 #1

I'm new to this forum. If this isn't the right place to post this I apologize. Under the Bitcoin section there was something for software development, but this isn't really Bitcoin related.

As a project, I want to write a Ravencoin (X16R) miner. I've been working on this by myself for a while now, but I'm getting nowhere. Turns out it's very hard to find documentation for this. What I've gathered is that I need to write the networking (Stratum) code to communicate with the pool and the actual mining code. The Stratum stuff I can do, it's the mining that gets me.

What I understand so far:
In Bitcoin, what you're doing is double hashing the 80 byte (I think) block header, changing the nonce and, once that overflows, the coinbase transaction (and some bits of the version?). You do this until the hash ends with or begins with a certain amount of zeros. You also build a branch of transactions over and over if you change the coinbase. Am I correct so far?

With Raven, there are 16 hashing algorithms, that much is clear. Looking them up they're all just variants of SHA3. The last 8 bytes of the previous hash are supposed to determine which you use.


Other than that, I'm not sure where to start. I want to do this from scratch if possible, only minimally looking at other's source code. I'm doing this in C# other than GPU mining code when I get to that (OpenCL/CUDA are in C++ or C, correct?). I'm adept at writing C# and I know a little C++.

Should I start with a different algorithm (like Bitcoin's SHA256) before I dive right into Raven?

Are there articles I can read or something that I'm not seeing? If anyone can provide some sort of insight I would appreciate it. Thanks! Smiley
1714027396
Hero Member
*
Offline Offline

Posts: 1714027396

View Profile Personal Message (Offline)

Ignore
1714027396
Reply with quote  #2

1714027396
Report to moderator
1714027396
Hero Member
*
Offline Offline

Posts: 1714027396

View Profile Personal Message (Offline)

Ignore
1714027396
Reply with quote  #2

1714027396
Report to moderator
1714027396
Hero Member
*
Offline Offline

Posts: 1714027396

View Profile Personal Message (Offline)

Ignore
1714027396
Reply with quote  #2

1714027396
Report to moderator
It is a common myth that Bitcoin is ruled by a majority of miners. This is not true. Bitcoin miners "vote" on the ordering of transactions, but that's all they do. They can't vote to change the network rules.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714027396
Hero Member
*
Offline Offline

Posts: 1714027396

View Profile Personal Message (Offline)

Ignore
1714027396
Reply with quote  #2

1714027396
Report to moderator
1714027396
Hero Member
*
Offline Offline

Posts: 1714027396

View Profile Personal Message (Offline)

Ignore
1714027396
Reply with quote  #2

1714027396
Report to moderator
1714027396
Hero Member
*
Offline Offline

Posts: 1714027396

View Profile Personal Message (Offline)

Ignore
1714027396
Reply with quote  #2

1714027396
Report to moderator
Mattthev
Sr. Member
****
Offline Offline

Activity: 966
Merit: 359


👉MINING-BIOS.eu💲⛏


View Profile WWW
November 17, 2018, 09:09:53 PM
 #2

https://github.com/Ravencoin-Miner/Ravencoin

Mining Bios with Performance Timings 👍 Mining-Bios.euPBE 1.7PBE 3 PRO👌⛏│AFFILIATE system 10% ref 💰💲BTC│👉 XMR-AEON-STAK 🔝⛏ Monero V9 (CNv4) ✅│XMRig AMD🔝⛏ CNv4 ✅
FIAT from BINANCE to REVOLUT 💳│🚀Upcoming/Active ICO list📈🤑│👉Free Bitcoin BTC Faucet💰💲│Guides:RX 470/480/570/580, VEGA Bios Mod Tutorial - SRB, PBE 💰💲│PBE.eu
CRYPTO to FIAT BTC💲💳│ How to Mine XMR/RYO and CN coins + Miners Downloads💰⛏│Guides:How to Mine AEON💰⛏
monerobiosedit@gmail.com│✅Did I help you? Give me some +Merit 🤜🤛👌
NightEule5 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 17, 2018, 09:55:19 PM
 #3

I want to do this from scratch if possible, only minimally looking at other's source code.

I guess this is an unreasonable expectation then... :/
VasilyS
Member
**
Offline Offline

Activity: 618
Merit: 21


View Profile WWW
November 18, 2018, 12:06:33 PM
 #4

Ravencoin code works on the PoW consensus algorithm and the x16r cryptographic algorithm, which is a combination of 16 hash functions, the order of which constantly changes depending on the hash of the previous block (its last 8 bytes are taken into account).
Ravencoin is using following hash algorithms:
  • blake;
    bmw;
    groestl;
    jh;
    Keccak;
    Skein;
    Luffa;
    Cubehash;
    Shavite;
    Simd;
    Echo;
    Hamsi;
    Fugue;
    Shabal;
    Whirlpool;
    sha512.
The set of hash functions are currently identical to the X15 algorithm with the addition of SHA512. In the future the algorithms can be modified and extended to protect against ASICs.

                             ❱  CRYPTOPROFI  ❱
iSparta
Member
**
Offline Offline

Activity: 728
Merit: 10


View Profile
November 20, 2018, 06:58:40 PM
 #5

Ravencoin coin mining is currently mined on video cards using the following programs:
sgminer-x16r;
RavenMiner;
ccminer;
Z-Enemy-CUDA;
T-Rex.
Most of them are open source. You can take them as an example for your program.
NightEule5 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 20, 2018, 08:55:13 PM
 #6

Ravencoin code works on the PoW consensus algorithm and the x16r cryptographic algorithm, which is a combination of 16 hash functions, the order of which constantly changes depending on the hash of the previous block (its last 8 bytes are taken into account).
Ravencoin is using following hash algorithms:
  • blake;
    bmw;
    groestl;
    jh;
    Keccak;
    Skein;
    Luffa;
    Cubehash;
    Shavite;
    Simd;
    Echo;
    Hamsi;
    Fugue;
    Shabal;
    Whirlpool;
    sha512.
The set of hash functions are currently identical to the X15 algorithm with the addition of SHA512. In the future the algorithms can be modified and extended to protect against ASICs.

Ok. A few questions though:
Are they ran sequentially? Like, do you hash with one algorithm for one try and then the next for the next try and so on, with the order determined by the hash of the last block? Or are they nested, where you hash a hash again and again in that order? I suck at explaining stuff, does that make sense?

Also, is the SHA512 algorithm the SHA2 or SHA3 version? If it's the SHA3 version wouldn't it just be Keccak?

And lastly, some of these algorithms (if not all of them, excluding SHA512) can output different length hashes (Keccak has 224, 256, 384, 512 etc. for example). Which length are they supposed to be? I'm assuming 512 bits?

Ravencoin coin mining is currently mined on video cards using the following programs:
sgminer-x16r;
RavenMiner;
ccminer;
Z-Enemy-CUDA;
T-Rex.
Most of them are open source. You can take them as an example for your program.

I'm curently looking at the source for RavenMiner but I'll check those out too. Smiley
whitefire990
Copper Member
Member
**
Offline Offline

Activity: 166
Merit: 84


View Profile
November 21, 2018, 04:57:33 AM
 #7

Any attempt to produce an X16R miner from white papers and first principles will fail 100%.  If you are new to mining algorithms you must realize that every mining algorithm has within it a tremendous amount of tribal knowledge.  Various bit widths, round constants, parameters, conventions, endianness, all changed or modified from original algorithm specifications without documentation of any kind.  Mining algorithms have been developed and tweaked from earlier code, which was itself tweaked from earlier code, and so on.  SHA-3 refers to a specific and final Keccak variant after several revisions by the original development team.  No crypto algorithm actually uses SHA-3, they use what they call 'Keccak' which is an earlier version of that specification, and different crypto algorithms use different variants of Keccak based on different papers published on different dates.  There is simply no hope to make a working miner without starting with existing open source code that works.



crairezx20
Legendary
*
Offline Offline

Activity: 1638
Merit: 1046



View Profile
November 21, 2018, 07:22:28 AM
 #8

Ravencoin coin mining is currently mined on video cards using the following programs:
sgminer-x16r;
RavenMiner;
ccminer;
Z-Enemy-CUDA;
T-Rex.
Most of them are open source. You can take them as an example for your program.

I'm curently looking at the source for RavenMiner but I'll check those out too. Smiley

You can try the Z-enemy it gives me higher hashrate compared to other mining software.

You can find the z-enemy here in the forum.
You can check their official thread here https://bitcointalk.org/index.php?topic=3378390.0
NightEule5 (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 22, 2018, 09:06:36 PM
 #9

Any attempt to produce an X16R miner from white papers and first principles will fail 100%.  If you are new to mining algorithms you must realize that every mining algorithm has within it a tremendous amount of tribal knowledge.  Various bit widths, round constants, parameters, conventions, endianness, all changed or modified from original algorithm specifications without documentation of any kind.  Mining algorithms have been developed and tweaked from earlier code, which was itself tweaked from earlier code, and so on.  SHA-3 refers to a specific and final Keccak variant after several revisions by the original development team.  No crypto algorithm actually uses SHA-3, they use what they call 'Keccak' which is an earlier version of that specification, and different crypto algorithms use different variants of Keccak based on different papers published on different dates.  There is simply no hope to make a working miner without starting with existing open source code that works.

That makes sense. I'm following source code now for the mining stuff and writing the Statum code myself using various documents. I've gotten that to work and I'm now writing the mining code.
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!