Author

Topic: [Electrum] merchant script (Read 4069 times)

newbie
Activity: 16
Merit: 0
November 19, 2015, 01:39:09 AM
#14
has anybody successfully implemented this into a woocommerce store?  if so, could you give an overview of how u accomplished it?

im struggling to find something for woocommerce that doesn't require a full middleman service like bitpay.


Stumbled upon this a while back

https://wordpress.org/plugins/bitcoin-payments-for-woocommerce/installation/

Haven't used it so don't know if it works (last updated a year ago).
member
Activity: 139
Merit: 13
November 18, 2015, 12:38:38 PM
#13
has anybody successfully implemented this into a woocommerce store?  if so, could you give an overview of how u accomplished it?

im struggling to find something for woocommerce that doesn't require a full middleman service like bitpay.
sr. member
Activity: 412
Merit: 287
October 28, 2013, 09:13:33 AM
#12
This is correct. It knows about everything's created in it's own wallet, and will track the default, 5, addresses that can be generated from the keys there. But it needs to be told how many addresses to watch if coins are to be sent to addresses beyond those 5!
Stn
full member
Activity: 227
Merit: 100
October 26, 2013, 10:05:12 PM
#11
I'm seems getting it. Correct if I'm wrong. All these concerns with the gap limit applied to the case when new addresses generated outside of the client using deterministic features. If new addresses created by the client itself I should not care any gap limit as the client will be aware anyhow of these new addresses.

So question now turns to is merchant.py script isolated from the client? Or client aware of it activities and tracks addresses created by the merchant.py?
legendary
Activity: 3682
Merit: 1580
October 26, 2013, 02:05:12 PM
#10
It depends on what you set your client up with.

I have set my client up with the default value which is unknown to me right now. I can find out it of course but it doesn't matter. I still don't understand if my rate of unused addresses say 50% what gap limit I'm obliged to?

I don't understand whole magic of this gap limit adjustment. If I need permanent supply of new addresses why should I care if they generated by 20, by 200 or by 2000 items per bunch? What correlation between gap limit ("bunch size" if I got it right) and  number of unused addresses?

Gap limit basically means the number of extra addresses the client tracks and displays at any one point in time. Extra addresses are counted from the used address with the highest index that electrum was tracking. It means the following:

The default gap limit is 5 so you have 5 empty addresses to start with index 0 - 4

You receive bitcoins in address with index 0. Electrum now starts tracking addresses with index 0-5.

You receive coins to address with index 4. Electrum now starts tracking addresses 0 - 9.

What does this mean? It doesn't affect coins sent to addresses with high index numbers. You have the seed and are always in control of any coins sent to derived addresses. But you may not know about those coins if the gap limit is too low. So if you have hundreds of transactions in a day with large gaps of unused addresses between transactions you may have to increase the gap limit to see those addresses in electrum.
legendary
Activity: 1896
Merit: 1353
October 24, 2013, 11:28:45 PM
#9
the gap limit is hidden from the gui in 1.9, so I guess suggesting to modify it was a bad idea.
I will try to find a better solution for the merchant script
Stn
full member
Activity: 227
Merit: 100
October 24, 2013, 11:01:43 PM
#8
It depends on what you set your client up with.

I have set my client up with the default value which is unknown to me right now. I can find out it of course but it doesn't matter. I still don't understand if my rate of unused addresses say 50% what gap limit I'm obliged to?

I don't understand whole magic of this gap limit adjustment. If I need permanent supply of new addresses why should I care if they generated by 20, by 200 or by 2000 items per bunch? What correlation between gap limit ("bunch size" if I got it right) and  number of unused addresses?
sr. member
Activity: 412
Merit: 287
October 24, 2013, 09:18:15 AM
#7
It depends on what you set your client up with. The electrum client regards the gap limit the total number of addresses derived from the one MPK to watch, as it's expecting payments on them.

If you don't expect to receive much, you could just leave it at 200 and be happy your client won't start missing addresses above this. Whereas, if you were expecting frequent transactions to addresses generated from the mpk you should set a high gap limit, like 2000. I don't think there IS a limit, and am not sure if there is any performance concerns by watching so many addresses.

You can reset your client, use the seed and the mpk to recover your private key, and set the gap limit to something higher if you generate more addresses than your current gap limit.
Stn
full member
Activity: 227
Merit: 100
October 24, 2013, 02:13:28 AM
#6
however, need to manually adjust your "gap limit".
I caught this phrase several times in different sources. Adjust to what? Any recommendations?
legendary
Activity: 1896
Merit: 1353
November 14, 2012, 04:04:56 AM
#5
note: the version of this script included in the 1.3 package does not work.
Please use the version in the git repo.
member
Activity: 85
Merit: 10
November 14, 2012, 03:42:06 AM
#4
I like it because it's so simple. Looks easy to setup and easy to use.
No blockchain is needed and the interface is trivial to use.
hero member
Activity: 714
Merit: 500
November 13, 2012, 08:10:07 PM
#3
Great!
legendary
Activity: 1199
Merit: 1012
November 13, 2012, 05:49:20 PM
#2
This is, IMO, as simple as it can get.

Since addresses are generated using an Electrum master public key, it is possible to visualize payments in the Electrum client; you will, however, need to manually adjust your "gap limit".
There are a few unfinished things, such as requesting a given number of confirmations, but I thought it would be ok to publish it now.

The script is being used at https://ecdsa.org


Great script, thanks a lot!

---

For people who don't know where to get master public key value, here is a hint:
Code:
electrum eval wallet.master_public_key
(run from command line)

---

I hacked the script and limited its functionality to solely bitcoin address generation. No database or running electrum is required. Not sure if anybody else needs it, but here it is:
  electrum-address-generator.py - generates deterministic bitcoin address by index via command line or passwordless RPC call (getaddress )
  electrum-address-generator.conf.template - specifies listening port and master_public_key (edit it and rename to electrum-address-generator.conf)
legendary
Activity: 1896
Merit: 1353
October 08, 2012, 08:37:46 AM
#1
I just added a new script to Electrum, named "merchant.py"

It is a daemon that manages payments for a web server. It creates Bitcoin addresses using a master public key (so you do not leave your private keys on the server), detects when payments are received and notifies your web application.

The workflow goes like this:

 - the server sends a request to the daemon via POST. the request contains an ID, an amount to be paid, an expiration period.
 - the daemon answers with a bitcoin address, where the customer needs to send the coins.
 - later, the daemon will send a POST to the webserver, to notify that payment has been received OR that the request has expired

This is, IMO, as simple as it can get.

Since addresses are generated using an Electrum master public key, it is possible to visualize payments in the Electrum client; you will, however, need to manually adjust your "gap limit".
There are a few unfinished things, such as requesting a given number of confirmations, but I thought it would be ok to publish it now.

The script is being used at https://ecdsa.org
Jump to: