Bitcoin Forum
June 25, 2024, 02:52:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: November 24, 2023, 10:33:50 AM
...

it would be awesome if there's a CUDA version for it.

I can give you this same script that works in C++ but you have to do the GPU part yourself.CUDA programming can be complex, and proper error handling and synchronization are crucial. Also, not all parts of your program may benefit from GPU acceleration, so it's essential to profile and optimize as needed.


Code:
import bit
import hashlib, random
import platform
from time import time
import os
import sys
import ctypes

nbits = 130
low = 2**(nbits-1)
high = -1+2**nbits
diff = high - low

filename ='tes.bin'
with open(filename,'rb') as f:
    add = f.read()#.split()
#add = set(add)

if platform.system().lower().startswith('win'):
    dllfile = 'ice_secp256k1.dll'
    if os.path.isfile(dllfile) == True:
        pathdll = os.path.realpath(dllfile)
        ice = ctypes.CDLL(pathdll)
    else:
        print('File {} not found'.format(dllfile))

elif platform.system().lower().startswith('lin'):
    dllfile = 'ice_secp256k1.so'
    if os.path.isfile(dllfile) == True:
        pathdll = os.path.realpath(dllfile)
        ice = ctypes.CDLL(pathdll)
    else:
        print('File {} not found'.format(dllfile))
else:
    print('[-] Unsupported Platform currently for ctypes dll method. Only [Windows and Linux] is working')
    sys.exit()

ice.scalar_multiplication.argtypes = [ctypes.c_char_p, ctypes.c_char_p]            # pvk,ret
ice.point_subtraction.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]  # x1,y1,x2,y2,ret
ice.init_secp256_lib()

def scalar_multiplication(kk):
    res = (b'\x00') * 65
    pass_int_value = hex(kk)[2:].encode('utf8')
    ice.scalar_multiplication(pass_int_value, res)
    return res

def point_subtraction(pubkey1_bytes, pubkey2_bytes):
    x1 = pubkey1_bytes[1:33]
    y1 = pubkey1_bytes[33:]
    x2 = pubkey2_bytes[1:33]
    y2 = pubkey2_bytes[33:]
    res = (b'\x00') * 65
    ice.point_subtraction(x1, y1, x2, y2, res)
    return res

def new_pos(full_bytes):
    pos = hashlib.sha256(full_bytes).digest()
    return pos

def fixrange(full_bytes):
    t = low + int(full_bytes.hex(), 16) % diff
    return t

def pub2upub(pub_hex):
    x = int(pub_hex[2:66], 16)
    if len(pub_hex) < 70:
        y = bit.format.x_to_y(x, int(pub_hex[:2], 16) % 2)
    else:
        y = int(pub_hex[66:], 16)
    return bytes.fromhex('04' + hex(x)[2:].zfill(64) + hex(y)[2:].zfill(64))

def upub2cpub(upub_bytes):
    x1 = upub_bytes[1:33]
    prefix = str(2 + int(upub_bytes[33:].hex(), 16) % 2).zfill(2)
    return bytes.fromhex(prefix) + x1

st = time()
key_seed = b''
m = 1
while True:
    pubkey = "03633cbe3ec02b9401c5effa144c5b4d22f87940259634858fc7e59b1c09937852"
    P = pub2upub(pubkey)
    key_seed = new_pos(key_seed)
    qfix = fixrange(key_seed)
    #qfix = m * 1000000  # Use an interval of 1000000 for qfix (stride)
    tpub = bytes(bytearray(scalar_multiplication(qfix)))
    subP = bytes(bytearray(point_subtraction(P, tpub)))
    cpub = bytes(upub2cpub(subP))
    m += 1

    msg = 'Test Cpub : {total}, {num}, {password} '.format(total=m, num=qfix, password=bytes(cpub).hex())
    sys.stdout.write('\r' + msg)
    sys.stdout.flush()

    if cpub in add:
        print("Winner Found!:{num}, {password} ".format(num=qfix, password=bytes(cpub).hex()))
        f = open (u"Winner.txt","a")
        f.write("num:" + str(qfix) +'\n' +
                "cpub:" + str(bytes(cpub).hex())+ '\n\n')
        f.close()
        break
print('[-] Completed in {0:.2f} sec'.format(time() - st))

can you give me the same script that works in cpp? Thanks
2  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: October 16, 2023, 02:54:58 PM
can anyone kindly provide an example of public key subtraction code in python ?
3  Economy / Collectibles / Re: [Auction] Ether Legends digital ICO card 67/100 (digital) on: May 20, 2019, 05:08:51 PM
0.00022BTC

Winner. You send me a ETH wallet that can hold ERC721. I send you the asset.

Due to BTC miner fee you get it for free.

Not my lucky day  Cheesy Grin
4  Economy / Collectibles / Re: [Auction] Ether Legends digital ICO card 67/100 (digital) on: May 20, 2019, 05:03:37 PM
0.00022BTC
Wow.  Nice shot bro   

 @JanEmil my ether wallet at my profile
5  Economy / Collectibles / Re: [Auction] Ether Legends digital ICO card 67/100 (digital) on: May 20, 2019, 04:56:06 PM
0.00021
6  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: August 05, 2018, 03:18:29 AM
I don't think there is a pattern in this puzzle. because the owner sends bitcoin randomly. and we know that the bitcoin address is between 2^n. and after the owner knew the puzzles were a bone of contention, the owner promised to increase the reward to 10 times and he did it.
good luck guys,there is 36,028,797,018,963,968 addresses to find puzzle number 56
7  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN][AIRDROP]🚀⚡✅FAITHCOIN-Faith Powered Cryptocurrency🚀⚡✅ on: February 14, 2018, 07:33:19 AM
Believe in FAITH
8  Local / Altcoins (Bahasa Indonesia) / Re: octoincoin indonesia on: February 02, 2018, 08:09:25 PM
Octoin masih saudara sama bcc itu.
9  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] Hexagon Token - Revolutionasing Crowdfunding Industry on: February 01, 2018, 02:06:58 PM
Waiting for octagon wallet private Beta 1 released.
10  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN][AIRDROP PRE-SALE] BitcoinToken (BTK) Easily Transferable, Easily Tradable on: January 28, 2018, 12:51:51 PM
I hope bitcoin token have own blockchain
11  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] [ICO] VIRTUAL CASH (VCA) ICO - Shopping & Exchanger on: January 27, 2018, 04:30:43 PM
Need more information about your project
12  Alternate cryptocurrencies / Tokens (Altcoins) / Re: ClassyCoin on: January 19, 2018, 03:38:39 AM
Waiting for android apps released
13  Alternate cryptocurrencies / Tokens (Altcoins) / Re: [AIRDROP] eMONERO [EXMR] Started. on: December 24, 2017, 06:24:31 PM
Wait and see
14  Economy / Games and rounds / Re: Bitcore BTX: first hybrid fork, lowest fees - Christmas RAFFLE 3 final round on: December 23, 2017, 07:15:57 PM
Table 2 : 0
15  Alternate cryptocurrencies / Tokens (Altcoins) / Re: [ANN][ICO is LIVE] BTCx - The Most Advanced Version of Bitcoin - Privacy Matters on: December 21, 2017, 04:07:46 AM
Lets go BTCx, go to the moon.  Grin Grin Grin
16  Alternate cryptocurrencies / Announcements (Altcoins) / Re: ALFA token - Decentralized Assets Hodl - Airdrop - COMMUNITY PROJECT- Join us! on: December 16, 2017, 09:27:52 AM
Nice project,good luck dev
17  Alternate cryptocurrencies / Tokens (Altcoins) / Re: [ANN][ICO][AIRDROP] 🌟🌟🌟 Who is Satoshi?🌟🌟🌟 Q/A platform - SWT token on: December 14, 2017, 04:24:27 PM
Nice cristmas gift  Grin Grin Grin
18  Economy / Services / Re: Vote for DENT to Get Listed at KuCoin Exchange and Get a Chance to win $700 USD on: December 10, 2017, 04:03:44 PM
1G5pk4Ni4QHjbwABz1nXLP5EVtbTXXimmo
Thats my kucoin btc address
19  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN][cryptopia][airdrop]LIZI for contest winner [reatime airdrop] on: December 08, 2017, 05:35:08 PM
Nice coin, more bounty and exchange i hope
20  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN][ICO] CRYPTOLENDING/ STAKING, TRADING & LENDING/TO GET 16% PROFIT PER MONTH on: December 06, 2017, 05:35:20 PM
Good luck to your project
Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!