Bitcoin Forum
November 10, 2024, 05:55:33 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [ANN] Scripts to predict superblocks JKC,SXC,DMD,ELP,GDC,GIL,LKY,NUG,PHS,SPT,STR  (Read 3382 times)
This is a self-moderated topic. If you do not want to be moderated by the person who started this topic, create a new topic.
hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 30, 2013, 11:47:54 AM
Last edit: August 05, 2013, 08:46:06 AM by hotcoldcoin
 #1

Many altcoins now include superblocks or variable reward blocks.  For some coins (JKC, SXC) it is possible to determine the reward for all possible blocks.   For other coins (CDC, DMD, ELP, GDC, GIL, GRW, LKY, NUG, PHS, RED, SPT, STR) it is only possible to determine the reward of the next block.

Script repository:

https://github.com/superblocks/superblocks

readme:
Quote
Superblocks - Version 0.4.2
===========================

A collection of programs to determine the Next Block Reward for
cryptocurrencies with superblocks and/or variable reward blocks.

Discussions: https://bitcointalk.org/index.php?topic=264740.0

Files:

* README.md - This file!
* TODO - To do list for Superblocks project

* makefile - Makefile to create all these fun little programs

* test-next.sh - Test script to test these fun little programs

* superblocks.cpp - main controller for Get Next Block Reward
* superblocks.hpp - includes and Superblocks class
* utils.cpp - Mersenne Twister random, hex2long

* next-elp.cpp - Get Next Block Reward for [ELP] Elephantcoin
* next-gil.cpp - Get Next Block Reward for [GIL] Gil
* next-lky.cpp - Get Next Block Reward for [LKY] Luckycoin
* next-nug.cpp - Get Next Block Reward for [NUG] Nuggets
* next-spt.cpp - Get Next Block Reward for [SPT] Spots

* list-jkc.cpp - Generate list of all superblocks for [JKC] Junkcoin
* list-sxc.cpp - Generate list of all superblocks for [SXC] Sexcoin
* rewardlists/rewardlist.jkc.txt - List of JKC superblocks up to block 100,000
* rewardlists/rewardlist.sxc.txt - List of SXC superblocks up to block 100,000

* precom-nug.cpp - Precompute lucky hash cut outs for [NUG] Nuggets
* precom-spt.cpp - Precompute lucky hash cut outs for [SPT] Spots


Coins
=====

Superblock Coins that seed with Block Height:
* JNK - Junkcoin - https://github.com/Hartland/JKC
* SXC - Sexcoin - https://github.com/sexcoin-project/sexcoin

Superblock Coins that seed with the Previous Block Hash:
* CDC - Cloudcoin - (no repo)
* DMD - DiamondCoin - https://github.com/diamondcoinproject/diamondcoin
* ELP - ElephantCoin - https://github.com/elephantcoin/elephantcoin
* GDC - Grandcoin - https://github.com/grandcoin/grandcoin
* GRW - Growthcoin - https://github.com/growthcoinproject/growthcoin
* LKY - Luckycoin - https://github.com/LuckyCoinProject/Luckycoin
* NUG - Nuggets - https://bitbucket.org/mytwobits/nuggets
* PHS - Philosopherstone - https://github.com/philosopherstonecoin/philosopherstone
* RED - Redcoin - https://github.com/redcoinproject/redcoin/
* SPT - Spots - https://github.com/spots-project/spots
* STR - Starcoin - https://github.com/starcoinproject/starcoin

Variable Reward Coins that seed with the Previous Block Hash:
* GIL - Gil (variable) - https://github.com/hydroponica/gil 

Coins that seed with Current Block Hash, or other methods:
* ?

Donate
======

Donate? More Code? Donate! More Fun!

* BTC: 16SUC5BXqRrLJc4X8FY8DA1hRyMexDvjfZ
* LTC: LQfRTHVMv66PZQkgJPXRVB5TeBiw52eKtZ
* NMC: N21qPigWkowtq9K2Q4rhRgAcACkhvgvdRw
* CDC: BxZkn1EK1JMzPJprnaXjJYMwRbK86gPeeG
* DMD: dJrkor1TjfZBuccKL1WorSWW5NYYucYQkA
* ELP: e7Xxn4c3A2UwYUtVNrBSph45LP4SLCSf1w
* GDC: g8Dyhc6UhvoKdeavVwr3FKR1UuM9tm4cfW
* GIL: 78WWxherV8oUa79pVYXuV36VsYDobxJTU7
* GRW: GPHPcCWUpHTdP5Mp4CCEdvMbM99VzBvNe6
* JNK: 7Xr7wox9CKGMPYHuWxsDyANHW3UkMgViUm
* LKY: L1KpUBC5CudWjycbGyC713og1gTzP4o9qi
* NUG: NRMSNpyoTzQmeaT7RVC1uoSPni1ebEV99m
* PHS: 9YY8sMSakDajUhzLe4XpPnjDeZmTt5iXMV
* RED: Re4GFhN79S7nC3ZocqrZnocgpk5CJ5nf3E
* SPT: MDLdRW5wLT29CH2rMEC4TRd2uCEpScjNZE
* STR: sPgsGeSYaymrXnVMBhAxpq3372ZZriJ6Gs
* SXC: S3PsEofPrcaf1UhteGBtGvtUTFL93CEYqm
* Hash160: 3BA9B9CCDFF4B1CC65AB2E9D095A8C6EB9E1E09F


Open Source
===========

Copyright (c) 2013 Superblock Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 30, 2013, 11:48:40 AM
 #2

RESERVED

jonoiv
Hero Member
*****
Offline Offline

Activity: 966
Merit: 526


🐺Dogs for President🐺


View Profile
July 30, 2013, 02:18:57 PM
 #3

And what do you intend to do with this info,  solo mine or join a pool for a few mins?

Pool owners should audit superblock payouts and only pay regular miners.

Signature for hire!
hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 30, 2013, 02:31:39 PM
 #4

And what do you intend to do with this info,  solo mine or join a pool for a few mins?

Pool owners should audit superblock payouts and only pay regular miners.

My intentions?   The same as every night, dear fellow, try to take over the world!

But seriously, are not most pools these days using reward systems that are hop-proof?   That would negate any extra reward a superblock-hopping miner would hope to get.

Solo mining is different, but you'd still have to find the block first.

Hydroponica
Full Member
***
Offline Offline

Activity: 182
Merit: 100


fml


View Profile
July 30, 2013, 02:34:09 PM
 #5

GIL does not have superblocks, 50 is the intended block reward, and I randomized it, to add a bit of dynamic to it. As well, it is completely random, and impossible to predict. There is an equal chance each block, to get 10 coins, as there is to get 50 coins.

hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 30, 2013, 02:42:43 PM
 #6

GIL does not have superblocks, 50 is the intended block reward, and I randomized it, to add a bit of dynamic to it. As well, it is completely random, and impossible to predict. There is an equal chance each block, to get 10 coins, as there is to get 50 coins.

Point taken about GIL not having superblocks per se.   And points for having the longest if/else block for rewards I've seen so far!

But the variable reward for the next block seems very predictable.   I'm looking at the code at https://github.com/hydroponica/gil/blob/master/src/main.cpp#L847  
Code:
...
        std::string cseed_str = prevHash.ToString().substr(8,7);
        const char* cseed = cseed_str.c_str();
        long seed = hex2long(cseed);

        int rand = generateMTRandom(seed, 400000);
...

It is seeding the Mersenne Twister with a number derived from the previous hash.    Thus we can always determine what reward the next block will have.   Already proved this with the luckycoin script.

Hydroponica
Full Member
***
Offline Offline

Activity: 182
Merit: 100


fml


View Profile
July 30, 2013, 02:44:42 PM
 #7

GIL does not have superblocks, 50 is the intended block reward, and I randomized it, to add a bit of dynamic to it. As well, it is completely random, and impossible to predict. There is an equal chance each block, to get 10 coins, as there is to get 50 coins.

Point taken about GIL not having superblocks per se.   And points for having the longest if/else block for rewards I've seen so far!

But the variable reward for the next block seems very predictable.   I'm looking at the code at https://github.com/hydroponica/gil/blob/master/src/main.cpp#L847   
Code:
...
        std::string cseed_str = prevHash.ToString().substr(8,7);
        const char* cseed = cseed_str.c_str();
        long seed = hex2long(cseed);

        int rand = generateMTRandom(seed, 400000);
...

It is seeding the Mersenne Twister with the a number derived from the previous hash.    Thus we can always determine what reward the next block will have.   Already proved this with the luckycoin script.

Hmmm, I guess that is true...But I wouldn't say GIL's reward is worth the effort, specially if you are dealing with a PPLNS pool.

hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 30, 2013, 02:46:54 PM
 #8

GIL does not have superblocks, 50 is the intended block reward, and I randomized it, to add a bit of dynamic to it. As well, it is completely random, and impossible to predict. There is an equal chance each block, to get 10 coins, as there is to get 50 coins.

Point taken about GIL not having superblocks per se.   And points for having the longest if/else block for rewards I've seen so far!

But the variable reward for the next block seems very predictable.   I'm looking at the code at https://github.com/hydroponica/gil/blob/master/src/main.cpp#L847   
Code:
...
        std::string cseed_str = prevHash.ToString().substr(8,7);
        const char* cseed = cseed_str.c_str();
        long seed = hex2long(cseed);

        int rand = generateMTRandom(seed, 400000);
...

It is seeding the Mersenne Twister with the a number derived from the previous hash.    Thus we can always determine what reward the next block will have.   Already proved this with the luckycoin script.

Hmmm, I guess that is true...But I wouldn't say GIL's reward is worth the effort, specially if you are dealing with a PPLNS pool.

Agreed.  This is more of an academic exercise at the moment  Wink

Hydroponica
Full Member
***
Offline Offline

Activity: 182
Merit: 100


fml


View Profile
July 30, 2013, 03:32:38 PM
 #9

GIL does not have superblocks, 50 is the intended block reward, and I randomized it, to add a bit of dynamic to it. As well, it is completely random, and impossible to predict. There is an equal chance each block, to get 10 coins, as there is to get 50 coins.

Point taken about GIL not having superblocks per se.   And points for having the longest if/else block for rewards I've seen so far!

But the variable reward for the next block seems very predictable.   I'm looking at the code at https://github.com/hydroponica/gil/blob/master/src/main.cpp#L847   
Code:
...
        std::string cseed_str = prevHash.ToString().substr(8,7);
        const char* cseed = cseed_str.c_str();
        long seed = hex2long(cseed);

        int rand = generateMTRandom(seed, 400000);
...

It is seeding the Mersenne Twister with the a number derived from the previous hash.    Thus we can always determine what reward the next block will have.   Already proved this with the luckycoin script.

Hmmm, I guess that is true...But I wouldn't say GIL's reward is worth the effort, specially if you are dealing with a PPLNS pool.

Agreed.  This is more of an academic exercise at the moment  Wink

Well good luck, I hate coins with ridiculous super blocks, so, I hope you kill em all

hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
July 30, 2013, 09:24:30 PM
Last edit: July 30, 2013, 09:39:05 PM by hotcoldcoin
 #10

updated 1st post with Superblocks 0.2 info.   New:

* Redcoin added to the list of superblock coins
* Gil more clearly denoted as using variable blocks
* Script to predict reward of next Gil block

Here's the test I ran for Gil predictor:
Code:
# GIL test
# Block: 34393 Reward: 12 Hash: ceff231a5473a0827325a2858980b3672308a81c6e0c6db1e5ae05b8f67b7900
# Block: 34392 Reward: 15 Hash: 25bd32e1edbc6bfd6a262b778d221da43b247df97a2f22c25ee87633731e03d8
$ ./gil 25bd32e1edbc6bfd6a262b778d221da43b247df97a2f22c25ee87633731e03d8
prevHash: 25bd32e1edbc6bfd6a262b778d221da43b247df97a2f22c25ee87633731e03d8
cseed: edbc6bf
seed: 249284287
rand: 24274
Assuming nHeight > 3000
Next Block Reward: 12




hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 01, 2013, 07:31:37 PM
 #11

I'm a little faklempt.  Talk amongst yourselves.  I'll give you a topic: 

The nonce of the current block would be a better random seed then the hash of the current block.


hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 01, 2013, 09:36:00 PM
 #12

Well good luck, I hate coins with ridiculous super blocks, so, I hope you kill em all

That may be above my pay grade.    Might be technically possible to write a superblock miner for the Luckycoin clones that depend on 'cut-out' sections of the previous block hash to seed randomness.   It'd be a 2-block miner:   First it would have to find a normal block that includes the proper seed in the cut-out section.  Then it would have to NOT send that block to the network.  Instead it would continue mining for the next block, because it will be a superblock.  Only after the superblock is found, then the miner sends both new blocks to the network.

You'd have to have a lot of hashing power (comparatively for whatever chain your mining) to make it worth your time.   At the low hash rates of some of these coins, that wouldn't be a problem for some folks on this forum.


hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 02, 2013, 02:58:52 PM
 #13

All these superblock coins use a "cutout" section of the previous block hash.   The cutout is always a 7 character long section.   This cutout is converted from hex to an integer and used as the random seed.

So that means the range of all possible seeds is 0000000 to fffffff, or in integers: 0 to 268,435,455.    Not really a big number, in the scheme of things.   Pretty easy to pre-compute all the possible superblock cutouts for any coin.   

Time for another test script!   Results so far:  NUG has 2,608,358 possible winning cutouts, and SPT has 26,596 possible winning cutouts.    Run time to generate each list was ~1 hour on a lower power vps.

Why make these lists?  Another tiny research step towards a making an actual real working superblock miner!   






jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 02, 2013, 03:01:21 PM
 #14

Don't touch my NUG  Angry

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 02, 2013, 03:04:42 PM
 #15

Don't touch my NUG  Angry

Oh noes!#    But don't worry.    A working miner is far away in the future, especially If I'm the only one working on it.    And there are other coins that would be more worthwhile to "superblock-mine".


hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 02, 2013, 04:59:47 PM
 #16

Maybe a better baby step is to create new *coin rpc command:

getnextblockreward

entirely possible to do for:  CDC, DMD, ELP, GDC, GIL, JNK, LKY, NUG, PHS, RED, SPT, STR, SXC

I wonder if any of the devs of those coins would be interested in adding such a command to the official clients?


jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
August 02, 2013, 05:54:52 PM
 #17

Maybe a better baby step is to create new *coin rpc command:

getnextblockreward

entirely possible to do for:  CDC, DMD, ELP, GDC, GIL, JNK, LKY, NUG, PHS, RED, SPT, STR, SXC

I wonder if any of the devs of those coins would be interested in adding such a command to the official clients?
This would require them to actually know how to code

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
frobley
Hero Member
*****
Offline Offline

Activity: 708
Merit: 500


View Profile
August 02, 2013, 06:17:08 PM
 #18

Maybe a better baby step is to create new *coin rpc command:

getnextblockreward

entirely possible to do for:  CDC, DMD, ELP, GDC, GIL, JNK, LKY, NUG, PHS, RED, SPT, STR, SXC

I wonder if any of the devs of those coins would be interested in adding such a command to the official clients?
This would require them to actually know how to code

hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 04, 2013, 09:28:01 AM
Last edit: August 04, 2013, 09:44:14 AM by hotcoldcoin
 #19

First post updated with info for Superblocks Version 0.4.

https://github.com/superblocks/superblocks

New this version:
- added GRW (Growthcoin) to the superblock coin list
- better code, setup and ouput for 'Get Next Block Reward' scripts (GIL, LKY, NUG, SPT)
- better output for generate reward lists for JKC, SXC
- precompute lucky hash cut outs scripts for NUG, SPT
- a makefile!  
- a test script!

With the code structure change, it should be easier now to create 'Get Next Block Reward' programs for the rest of the superblock coins (CDC, DMD, ELP, GDC, GRW, PHS, RED, STR).   Coming soon!


hotcoldcoin (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
August 05, 2013, 08:49:07 AM
 #20

First post updated with info for Superblocks 0.4.2

https://github.com/superblocks/superblocks

New this version:
- added Get Next Block Reward script for ELP
- more code finangling and restructuring
- updated test script



Pages: [1] 2 »  All
  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!