1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
import hashlib
import time
start_time = time.time()
def sha256(message):
return hashlib.sha256(message.encode('ascii')).hexdigest()
def mine(message, difficulty=1):
assert difficulty >= 1
prefix = '0' * difficulty
for i in range(999999999999999999):
Replies
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
digest = sha256(sha256(str(hash(message)) + str(i)))
if digest.startswith(prefix):
print ("after " + str(i) + " iterations found nonce: "+ digest + " in %s seconds " % int((time.time() - start_time)))
break
mine("test message", 6)
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
https://app.qvault.io/playground/py
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
proper indentation was lost:
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
are you really going to hash from there?
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
lmao.
I would need to see the most recent block header I think.
I have an idea though, if you are bored or interested...
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
I used to CPU mine on free accounts
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
Underpowered mining is a sort of lottery; I have an idea for a game that would introduce character and item generation into the BSV block mining lottery.
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
naw, the free accounts mattered. it was enough horsepower when you stacked them up to make money
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
instead of just this basic mining code, the code would seek the latest BSV block, and grind a nonce on that block.
while the game itself would only need a six 000000 difficulty nonce to generate a character, it is possible that the nonce generated would
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
satisfy BSV's difficulty.
in that case, the winning nonce would be submitted to a pool, and the gamer who generated the character or item would win big money
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
the way that the game itself would read the hash, it would splice out the zero's and then take the hash into pieces.
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
I don't think that's how mining works
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
the first few pieces would be related to type of monster, the second few would be related to colors, and on and on.
monster types would then be somewhat grindable, and compatible with bitcoin miners
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
and the chances of the nonce working on BSV are .... well ... don't make laugh
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
I dont really know, but i do know it is possible to mine empty blocks
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
c'mon , it cannot be more than an order of magnitude more difficult that powerball
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
Is this high? 8,922,0127,294
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
come on twetch, don't fail me now. FTLOG
1LeVwABdDk7BywKon6U1uMm7SrnTcSsHc2 ·
Yeah you could mine an empty block if no one transacts for that time. You can’t go back and mine it after the fact because it was empty. Tweet activity alone would make that impossible.
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
I like my blocks empty. But large. Leave the mem pool alone. In fact. Just add more ram.
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
if my idea is possible at all,
there could be one transaction in the block:
the NFT character or item that the person grinding created.
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
folks, as far as I am aware, you don't have to pull a block into your software in order to grind a nonce on top of it, you just need a block header, which is low latency
(i am a newbie, please correct me)
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
in that cheezy code I posted, as i scan for a nonce, ANY nonce greater than six 000000 satisfies the condition.
one in a kajillion may be at BSV difficulty level
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
If that were true, couldn't I just grind on a pool, but if I find the golden nonce. Submit it as my own? hell no you can't do that.
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
you have to get the block header from somewhere and send it somewhere afaik
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
wouldn't that come as part of the getwork?
14JF47JG8zhbWovFXPsHvrBY7YNstcKDvq ·
YOU are capable of anything. 😂
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
if anyone is familiar with the old game 'Monster Rancher'...
the game took some data from any CD you placed into it, and used the code to create a monster.
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
well, a doublesha256 hash is pseudorandom number generation; and can be chunked into pieces that represent color codes, size, strength, life, etc
1EgdFi7rbQq9mwXib7ddN8mhSvTJthJKhF ·
Sir wa exactly is it pls dont tel me bsv
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
@24 am I crazy?
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
I was trying to make this more readable.
username@host:~/bitcoin-sv-1.0.7.beta/bin$ ./bitcoin-cli getdifficulty
89220127294.44095
1EgdFi7rbQq9mwXib7ddN8mhSvTJthJKhF ·
Aaah oke yeah now i can read it
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
000000000000000003f94da43783d485d4e6336d369db0ce3a103d9338df5be4
fren, its only 17 zeros instead of six, lmao
1EgdFi7rbQq9mwXib7ddN8mhSvTJthJKhF ·
Haha how are you going bitsko
123vb6dSr4XjFt15rPBM7MykA416Fyzd6M ·
zeroes make my head spin
1EgdFi7rbQq9mwXib7ddN8mhSvTJthJKhF ·
Meee tooooo
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
username@host:
this part is someone logged into a 'linux shell'
/bitcoin-sv-1.0.7.beta/bin$
this is the folder they are in, and a 'command prompt' ($ or #)
./bitcoin-cli
this is bitcoin command line interface program
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
getdifficulty
this is a bitcoind program
89168161618661.645646
this is the result. in linux, when the result pops up on the terminal, it is called 'stdout' or 'standard output'
13bJsMyjiNF21qYTLK5tZizwEovpT6DNeu (3375) ·
People love games of chance.
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
technically possible to make a sub game of grinding a block hash, connected to a real pool?
13bJsMyjiNF21qYTLK5tZizwEovpT6DNeu (3375) ·
Sure, why not?
1KKwemSCUDZSyQ1Bs7bqfCocE5fogkpKw1 (725) ·
Gamifying mining at a loss ought to serve to increase overall security beyond the cost benefit of mining, if it were popular enough.