Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XRPL seed / address generation issue #2748

Open
wilhelm31620 opened this issue Sep 4, 2024 · 0 comments
Open

XRPL seed / address generation issue #2748

wilhelm31620 opened this issue Sep 4, 2024 · 0 comments

Comments

@wilhelm31620
Copy link

wilhelm31620 commented Sep 4, 2024

I know I'm probably missing something obvious but I'm really not sure what it is.

I made a simple search for finding strings in XRPL address using python.
It works well, it finds addresses. BUT...

The mnemonic when put into a wallet is not correct. Dropped mnemonic into one of the online code things to check address and it agrees with Xaman wallet, so I'm sure it's me.
Really not sure what I'm missing.

Any help would be good.

given - cigar swim extra grain half trade pair slice chase short kick bid
address should be - rJFsq5AXWe7mb2wTPJHBbAd84v34SXJWca

import xrpl
import random
import bip39
import threading

from xrpl.clients import JsonRpcClient

url = "https://s1.ripple.com:51234/"
client = xrpl.clients.JsonRpcClient(url)


stringy = ["rWill", "rRach", "rFaye","rBruce","rr"]
steps = len(stringy)
print(steps)
runs = 1

def my_thread(count, stringy):
    #step_count = len(stringy)
    while count > 0:
        bytes_16 = (random.randbytes(16)) # 16 bytes is 12 words, 32 bytes is 24 words
        phrase = bip39.encode_bytes(bytes_16)
        
        
        phrase = "cigar swim extra grain half trade pair slice chase short kick bid" # use this to lock phrase for testing
        bytes_16 = bip39.decode_phrase(phrase)
        # print(bytes_16)

        #valid = bip39.check_phrase(phrase)
        #words = phrase.split()
        CryptoAlgorithm = xrpl.CryptoAlgorithm.SECP256K1 # SECP256K1 ED25519
        seed = xrpl.core.addresscodec.encode_seed(bytes_16,CryptoAlgorithm)
        wallet = xrpl.wallet.Wallet.from_seed(seed,algorithm=CryptoAlgorithm)
        #wallet.create(algorithm=CryptoAlgorithm.ED25519)
        keys = xrpl.core.keypairs.derive_keypair(seed)
        addr0 = xrpl.core.keypairs.derive_classic_address(keys[0])
        # addr1 = xrpl.core.keypairs.derive_classic_address(keys[1])
        # print(bytes_16)
        print(phrase)
        print(seed)
        print(keys)
        print(addr0)
        # print(addr1)
        print(wallet)
        addr_xrpl = addr0
      
     

        step_count = len(stringy)
        while step_count > 1:
            
            if stringy[step_count-1] in addr_xrpl:
                print(count, " - ", addr_xrpl, " ",keys, " ", seed)

            step_count = step_count-1
        count = count-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant