Post
Topic
Board Announcements (Altcoins)
Re: [ANN] Destiny | scrypt (pow/pos) | deflation coin | no premine
by
DestinyTeam
on 26/02/2016, 08:43:01 UTC
...
Hi thank you for share, which version of python are you using, i am trying to run in 3.5.1 and i am getting "missing parenthesis in call to print", some idea what can it be?
Now it should work with any python version
Code:
# type here desired prefix
IWANT="inc"

#do not change anything after the signal
#BEEP
b58_digits = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def base58_encode(n):
    l = []
    while n > 0:
        n, r = divmod(n, 58)
        l.insert(0,(b58_digits[r]))
    return ''.join(l)

lw=len(IWANT)
result=""

for i in IWANT:
  if not i in b58_digits:
    print "Address contain non b58 symbol"
    exit()

for i in range(16**6):
  pk=int(hex(i)+"0"*(8-len(hex(i))) + "0"*44,16)
  adr=base58_encode(pk)
  if adr[:lw]==IWANT:
    result=hex(i)+"0"*(8-len(hex(i))) + "0"*44
    break

result_string='base58Prefixes[PUBKEY_ADDRESS] = list_of'
for i in range(1,16):
  st=result[i*2:i*2+2]
  if st=="00":
    break
  else:
    result_string+="(%d)"%int('0x'+st,16)

result_string+=";"

print(result_string)

It is possible to calculate desired bits without iterating, there is no hashing after adding version byte, so its just a simple math to recalculate from numeration system with base 58 to hex. However looks like for FootyCash developer (https://bitcointalk.org/index.php?topic=1374929.20) it was too hard Wink
Thank you for sharing

Slack community is slowly growing. If you want to be inside please pm me your email.
All plans and updates before official announcement!
Welcome