0

I'm using getnewaddress bitcoin-cli function to generate wallet addresses but i need one address per token.

Is it possible to use a parameter like seed for random numbers to get the same address when i use the same token?

0

I finally found a solution. here is the function to get tone address per token:

try:
    addressjson=gateway.getaddressesbylabel(token)
    address=list(addressjson.keys())[0]
except:
    address=gateway.getnewaddress(token)
return address

this way if an address assiciated to the label: token exists we use. Otherwise we generate a new address with label token.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.