Bitcoin Forum
September 27, 2018, 10:16:59 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How to create a new public address using Python for an HD wallet?  (Read 1216 times)
687_2
Full Member
***
Offline Offline

Activity: 164
Merit: 100


View Profile
December 16, 2014, 01:40:19 AM
 #1

I searched but could not find a clear answer. Sorry in advance for terminology errors. This seems useful:

https://github.com/richardkiss/pycoin

However I'm not sure I understand how to do the following with that library:

1. Create a HD wallet (i.e. create a new Electrum wallet with seed and all that)
2. Create a new public key that is derived from that HD wallet, or from an existing wallet

My goal is to create a public address that can be presented to a customer on a website. The code will live on a remote server; I would like the public keys created to relate back to a private (offline) HD wallet.

1538086619
Hero Member
*
Offline Offline

Posts: 1538086619

View Profile Personal Message (Offline)

Ignore
1538086619
Reply with quote  #2

1538086619
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
jonald_fyookball
Legendary
*
Offline Offline

Activity: 1302
Merit: 1002


Core dev leaves me neg feedback #abuse #political


View Profile
December 16, 2014, 03:13:57 AM
 #2

here's a script you can look at which is similar to what you're trying to do. it's based off electrum.

https://bitcointalk.org/index.php?topic=694521.0

luv2drnkbr
Hero Member
*****
Offline Offline

Activity: 795
Merit: 1000



View Profile
December 16, 2014, 10:02:21 AM
 #3

You'll need to keep the master public key on the online machine, and then use the get_address() function the script jonald linked to.  Then on your offline machine, you can get the private keys for it with the get_private_key() function.

That being said, I'd recommend using BIP0032 HD wallets instead of Electrum.  Bip32 is becoming the standard for exactly that type of use case, and there are more tools and information about it.

687_2
Full Member
***
Offline Offline

Activity: 164
Merit: 100


View Profile
December 16, 2014, 04:24:54 PM
 #4

here's a script you can look at which is similar to what you're trying to do. it's based off electrum.

https://bitcointalk.org/index.php?topic=694521.0

Very useful, thanks.
687_2
Full Member
***
Offline Offline

Activity: 164
Merit: 100


View Profile
December 16, 2014, 04:35:28 PM
 #5

You'll need to keep the master public key on the online machine, and then use the get_address() function the script jonald linked to.  Then on your offline machine, you can get the private keys for it with the get_private_key() function.

That being said, I'd recommend using BIP0032 HD wallets instead of Electrum.  Bip32 is becoming the standard for exactly that type of use case, and there are more tools and information about it.

Thanks for the clarification; after looking into BIP0032 I found this library which I think will be perfect for this application:
https://github.com/jmcorgan/bip32utils

Abdussamad
Legendary
*
Offline Offline

Activity: 1862
Merit: 1064



View Profile WWW
December 20, 2014, 12:26:51 PM
 #6

I searched but could not find a clear answer. Sorry in advance for terminology errors. This seems useful:

https://github.com/richardkiss/pycoin

However I'm not sure I understand how to do the following with that library:

1. Create a HD wallet (i.e. create a new Electrum wallet with seed and all that)
2. Create a new public key that is derived from that HD wallet, or from an existing wallet

My goal is to create a public address that can be presented to a customer on a website. The code will live on a remote server; I would like the public keys created to relate back to a private (offline) HD wallet.



Try this WP plugin that I released recently:

https://bitcointalk.org/index.php?topic=900327.0

It's not bip32 compatible but will work with an Electrum MPK

You can use the shortcode or, if you know how to code php, call the get_address() function in your own plugin:

Code:
global $AbdBitcoinAddress;
$address = $AbdBitcoinAddress->get_address();

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!