Finally Made My Decred Address!

Discussion in 'Addresses' started by 418Sec, Jan 5, 2016.

  1. 2017/12/15 - Decred v1.1.2 released! → Release Notes  → Downloads
  1. 418Sec

    418Sec Member
    Advocate (Twitter)

    Jan 3, 2016
    122
    65
    Male
    #1 418Sec, Jan 5, 2016
    Last edited: Jan 11, 2016
    So I finally made my Decred address: DsRiCK1HE8NqwLMox9viomaNQBZS4LNDSrf

    Yeee... cause my name is Rick :3

    Here is the stupid python code I wrote for it:

    Code:
    import subprocess
    import os
    import time
    FNULL = open(os.devnull, 'w')
    
    out = "out.txt"               # The address, seed, private key output in out.txt
    store = "store.txt"           # the text file that will store all the generated address details
    genex = "dcraddrgen.exe"      # put the direct path link to the exe if its not in the same directory as the python code
    req = "Rick"                  # put your own name in place of 'Rick' (Make it less than 5 chars. should take lesser time
    mode = "-noseed"              # Dave said this will keep your money safe.
    size = len(req)
    got = False
    cnt = 0
    f2 = open(store, "a")
    start_time = time.time()
    while (got == False):
        subprocess.call([genex , mode, out], stdout=FNULL, stderr=subprocess.STDOUT)
        cnt += 1
    
        f1 = open(out, "r")
        lines = f1.readlines()
        addr = lines[0][15:]
        res = addr[:size]
        got = (res.lower() == req.lower())
        print (cnt, res, got)
    
        arrLine = '[';
        for line in lines:
            if (len(arrLine) > 1):
                arrLine += ', '
            arrLine += "'" + line.splitlines()[0].split(': ')[1] + "'"
        arrLine += '],\n'
        f1.close()
        f2.write(arrLine)
        if(got == False):
           os.remove(out)
    f2.close()
    print("Total time taken -> %s seconds" % (time.time() - start_time))
    
    
    I saved it as gen.py
    Then just run:
    Updated:
    *code cleaned up by @walkeralencar
    *added -noseed argument
    (for more details on that read the explanation by @davecgh https://forum.decred.org/threads/finally-made-my-decred-address.109/#post-1096 )


    Code:
    #!/bin/bash
    
    TEXT=nat
    COUNTER=0
    STAY=1
    TMPFILE=vanity
    while [ $STAY -eq 1 ]; do
    rm $TMPFILE
    dcraddrgen -noseed $TMPFILE >/dev/null
    grep $TEXT $TMPFILE >/dev/null
    grep Addr $TMPFILE| awk '{print $2}' | xargs grep ^..$TEXT >/dev/null
    STAY=$?
    COUNTER=$[$COUNTER+1]
    echo -ne "\rSearching: $COUNTER"
    done
    
    Bash script to do the same by @Karman , modified by @nat
    Save it as
    and run.


    Warning!!
    This is just for fun.
    In reality try to use a unique address per transaction.

    So don't use a (-noseed) address for receiving the Air Drop, as you wont be able to send the coins till wallet that supports (-noseed) addresses is released.
     
    RegenX, Freedom2Choose and Blizzy like this.
  2. Blizzy

    Blizzy Full Member

    Jan 4, 2016
    225
    109
    Male
    nice man!!i like people like you, you think your python code is stupid...but it isn't!!!

    Nice work!
     
    RegenX likes this.
  3. 418Sec

    418Sec Member
    Advocate (Twitter)

    Jan 3, 2016
    122
    65
    Male
    Thanks for the support man! :)
    I am working on a web based address generator for Decred.. will update once its finished.
     
  4. Freedom2Choose

    Freedom2Choose Full Member
    Designer

    Dec 17, 2015
    103
    118
    Designer
    USA
    Excellent work!
     
  5. walkeralencar

    walkeralencar New Member
    Translator (Português)

    Dec 29, 2015
    57
    24
    Male
    CTO and PHP Consultant
    Brasília-DF, Brazil
    Rick, create a gist with your code, i have done improvements, to save storage file in other format.
     
  6. 418Sec

    418Sec Member
    Advocate (Twitter)

    Jan 3, 2016
    122
    65
    Male
  7. badani

    badani New Member

    Dec 31, 2015
    8
    6
    Female
    India
    Good work. That's the problem with developers. They never know how much they are helping by posting small snippets of programming gems. Waiting for more gems on decred forums. :)
     
  8. walkeralencar

    walkeralencar New Member
    Translator (Português)

    Dec 29, 2015
    57
    24
    Male
    CTO and PHP Consultant
    Brasília-DF, Brazil
    Thanks Rick,
    Changelog:
    * improved string operation, removing extra close/open file
    * added a counter
    * simplified store file as sigle line json array format;
    * simplified output, like:
    Code:
    (100160, 'DsWdztH2', False)
    (100161, 'DsXwoLPR', False)
    (100162, 'DsXK4yfq', False)
    source code: https://gist.github.com/walkeralencar/7c1eaa5acc7470d5abf5

    PS.: yes! i have generated more then 100k dcrs :D until now, and dont get my choose one.
     
  9. 418Sec

    418Sec Member
    Advocate (Twitter)

    Jan 3, 2016
    122
    65
    Male
    Clean work! Nice!!
    ps. Took me around 250k addresses to generate the address I wanted. :D
     
  10. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    I would highly recommend using the -noseed argument if you want to generate a vanity address like this so it generates a completely separate key pair as opposed to an HD seed.

    I say this because without the flag the tool generates the first address for a well known path in a hierarchical deterministic chain based on a seed. Therefore generating a vanity address like this does based upon the HD generated address effectively reduces the number of unknown bits in the seed. That is obviously not ideal because when dealing with HD keychains, your seed is what is used to generate all addresses and their associated private keys that you will use. The net effect is doing this will make it ever so slightly easier to steal your funds.
     
    Blizzy and 418Sec like this.
  11. Gorei

    Gorei New Member

    Dec 28, 2015
    15
    14
    Male
    #11 Gorei, Jan 5, 2016
    Last edited: Jan 5, 2016
    Who wants also "customized" address and has Linux can try something like: for i in {1..1000}; do dcraddrgen -noseed address.${i}; grep 'Address' address.${i} |sed "s|Address: |${i}: |"; done
    This will generate 1000 addresses with names "address.1", "address.2" etc. You can change the number of addresses or anything else... And then you cat easily find your string by combination of find command and grep (and maybe some REGEXP) or you can check each address of your own. ;)
     
    Ham Varaka and Max Holandia like this.
  12. 418Sec

    418Sec Member
    Advocate (Twitter)

    Jan 3, 2016
    122
    65
    Male
    Ohh... I understand.
    Added the -noseed argument to the code.
    Thanks for the explanation man! :)
     
  13. walkeralencar

    walkeralencar New Member
    Translator (Português)

    Dec 29, 2015
    57
    24
    Male
    CTO and PHP Consultant
    Brasília-DF, Brazil
     
  14. walkeralencar

    walkeralencar New Member
    Translator (Português)

    Dec 29, 2015
    57
    24
    Male
    CTO and PHP Consultant
    Brasília-DF, Brazil
    I wrote another code, in PHP to save on database, since yesterday, i got 400k wallets, and dont found one with my name :(
     
  15. Maicol792

    Maicol792 New Member
    Advocate (BitcoinTalk)

    Jan 5, 2016
    40
    22
    Male
    hello, i have crated my first dcr address... but now i want try to use this vanity generator... how i can use this ?? sorry but i used help installed go and mingw32... now how i can generate my vanity address?

    thanks for all
     
  16. Freedom2Choose

    Freedom2Choose Full Member
    Designer

    Dec 17, 2015
    103
    118
    Designer
    USA
    Quick question. Does creating addresses based on the seed act much like a brain wallet, only with a more secure passphrase?
     
  17. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    Yes. The seed is the base of a BIP44 style hierarchical deterministic keychain. Thus, with the seed you can fully recover all of your addresses (and more importantly, their private keys that you need to spend any funds sent to them). That is why it's imperative to keep the seed well secured.
     
    418Sec and diegox104 like this.
  18. Freedom2Choose

    Freedom2Choose Full Member
    Designer

    Dec 17, 2015
    103
    118
    Designer
    USA
    Why does the seed pick actual words and not combine them with numbers as well? Could this potentially be brute forced or no?
     
  19. davecgh

    davecgh Hero Member
    Developer Organizer

    Dec 31, 2015
    642
    788
    Male
    United States
    #19 davecgh, Jan 6, 2016
    Last edited: Jan 8, 2016
    The seed is just a really large cryptographically random number (2^256 bits by default). The words are simply a mapping of the value 8 bits at a time according to the PGP word list.

    In other words, brute forcing the seed words is the same as brute forcing a cryptographically secure random number of the same bit length mapped onto the word list.

    EDIT: To put that into perspective, for a 128-bit seed, if you assume there are 7 billion people on the planet, every one of them has 10 computers, every one of those computes could test 1 billion seeds per second, and you could brute force the key after an average of half the total possibilities, you'd still need 77x10^24 (77 septillion or 77 trillion trillion) years to crack it through brute force on average.
     
    418Sec, diegox104 and Gorei like this.
  20. Grizzlebee

    Grizzlebee New Member

    Dec 28, 2015
    7
    4
    am I unclear in thinking that this could lead to selling a service for finding a vanity wallet address?
     
    Lee Sharp likes this.

Share This Page