Fri Feb 24, 2017 10:18 am
writing your own payment gateway is pretty difficult... I'd defenately suggest you to move any development to the testnet, and let experienced coders review any line you've written before switching to the main net.
As for your options to write a payment gateway, there are several:
- install bitcoind (the latest versions are HD), use the json-rpc API to generate new addresses, detect payments, validate,... pro: you have the full feature set; con: AFAIK, it's not possible to have a watch-only wallet, so you're always at risk for getting robbed
- install electrum, run it as a deamon, set up json-rpc (http://docs.electrum.org/en/latest/merchant.html). pro: you can setup the wallet using an xpub instead of generating a new HD wallet, that way you have a watch-only wallet, so the xprv isn't on the same online server
- using a web wallet with an API, like xapo, blockchain.infon,... con: when using a web wallet, you're not the (only) one in controll of your private key, so you're not the (only) one in controll of your funds
- pre-generate a bunch of addresses for a HD wallet, put the into a db (maybe sign them???), assign each new client his own payment address***
*** i've written a small python script to do this in the past, this script generates the first 1000 addresses for an electrum wallet with a given xpub (which can easily be exported from within electrum):
Code: Select all
from bitcoin import *
childkey1 = bip32_ckd('xpub_my_electrum_xpub', 0)
for counter in range(1000):
childkey2 = bip32_ckd(childkey1, counter)
key = bip32_extract_key(childkey2)
address = pubtoaddr(key)
print address
Trezor: the original hardware wallet, for sale =>
here
Ledger Nano S: keep your bitcoins safe! check it out =>
here
Check out my personal bitcoin tools website, filled with usefull, anonymous bitcoin tools =>
here