Author

Topic: A PSA to all GLBSE asset issuers (Read 1673 times)

hero member
Activity: 784
Merit: 1000
Casper - A failed entrepenuer who looks like Zhou
November 25, 2012, 11:50:23 AM
#11
The Blockchain.info send many API is actually quite good.
For weeks I've been using their service on "Know a Bit More" on distributing the rewards to our viewers using this address

Just something to bare in mind on using this API
1; Make sure the address is valid using Blockexplorer's service

2; Strip out space bar just in case since step 1 cant filter them out.
____Doing bad at above 2 will never have your TX accepted, learnt from mistakes_____

3;Make good logs. Only debit users when the TX id was returned to you (successful payment)

4; Keep your wallet (password) safe Cheesy

If you guys have got the list. Pay the dividend to the long awaited GLBSE bond holder!
legendary
Activity: 1666
Merit: 1000
November 25, 2012, 11:14:08 AM
#10
Meni,

Many thanks for the WONDERFUL advice and HOW-TO.  Just did a small test and it worked perfectly with MyWallet.  I am wondering how long the "URL" can be that is pasted into the browser bar?!?
In a casual search I encountered numbers of 5000-6000 characters being mentioned for modern browsers. You can try with more but if that fails, splitting addresses to several groups and paying each separately could work around this limitation.

Sorry Meni - in my haste I missed the portion of my question you answered in your original post.

Is there a limit with "sendmany" ?
There shouldn't be, but a limitation may exist because of the interface used. The command line may have a limit on the number of characters you can use it for; when using the MyWallet GET API there is a browser limit on the characters in the URI. I have successfully used the latter to send to 88 addresses with a 3606 character URI. If the API also accepts POST it could be more scalable, but slightly harder to use.
vip
Activity: 1358
Merit: 1000
AKA: gigavps
November 25, 2012, 10:58:19 AM
#9
I've had the same experiences as Meni and the mywallet API is much simpler and cleaner to use.

It's probably overkill but I am also generating records in a database and have a small interface to pull up contract holders with a list of payments.

I'm sure this accounting can be done through the blockchain, but it is nice having a simple interface to refer to.
donator
Activity: 2058
Merit: 1054
November 25, 2012, 10:56:31 AM
#8
Meni,

Many thanks for the WONDERFUL advice and HOW-TO.  Just did a small test and it worked perfectly with MyWallet.  I am wondering how long the "URL" can be that is pasted into the browser bar?!?
In a casual search I encountered numbers of 5000-6000 characters being mentioned for modern browsers. You can try with more but if that fails, splitting addresses to several groups and paying each separately could work around this limitation.
legendary
Activity: 1666
Merit: 1000
November 25, 2012, 10:26:50 AM
#7
Meni,

Many thanks for the WONDERFUL advice and HOW-TO.  Just did a small test and it worked perfectly with MyWallet.  I am wondering how long the "URL" can be that is pasted into the browser bar?!?
donator
Activity: 2058
Merit: 1054
November 25, 2012, 09:08:41 AM
#6
What a great opportunity to share some of my experiences.

It took some hairs being pulled out, but I finally managed to get sendmany to work. Some observations (in decreasing order of triviality):
1. You run bitcoind from the daemon folder with one of the commands in https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list.
2. You should specify the application data directory, if it is not the default, with -datadir=your_directory before the command.
3. You should unlock the wallet with walletpassphrase.
4. Your bitcoin.conf file should have settings to allow this, my own file looks exactly like this:
Code:
# JSON-RPC 
server=1
rpcuser=a
rpcpassword=b
rpcallowip=10.0.0.*
rpcport=8332
5. You can't use sendmany from an account which has no sufficient funds. However, you can move funds from one account to another even if the first account hasn't sufficient funds, and simultaneously creating the sending account if it does not exist.
6. On Windows, addresses should be triple-double-quoted.

So it can look for example like this:
Code:
bitcoind -datadir="C:\Bitcoin" walletpassphrase JustSomePassword 20
bitcoind -datadir="C:\Bitcoin" move "Sendmany sink" "Sendmany source" 0.003
bitcoind -datadir="C:\Bitcoin" sendmany "Sendmany source" {"""1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW""":0.001,"""1BTC1oo1J3MEt5SFj74ZBcF2Mk97Aah4ac""":0.001,"""1HUrNJfVFwQkbuMXwiPxSQcpyr3ktn1wc9""":0.001}
Both account names can be entered verbatim and needn't exist in advance.

However, after so doing I realized that the Bitcoin-qt GUI displays a list item for every address to which payment was sent this way. This is incredibly messy and I didn't want it.

So I ended up using blockchain.info MyWallet for this. I hoped it would have an interface where you can paste a tsv of addresses and amounts to send, but I could find no such thing. What it does have is an HTTP GET API. The syntax is available at https://blockchain.info/api/api_send. So after moving funds to MyWallet, you can enter this in your browser URL bar:
Code:
https://blockchain.info/merchant/your_id/sendmany?password=your_password&recipients={"1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW":100000,"1BTC1oo1J3MEt5SFj74ZBcF2Mk97Aah4ac":100000,"1HUrNJfVFwQkbuMXwiPxSQcpyr3ktn1wc9":100000}
Note that unlike bitcoind sendmany, the MyWallet API takes amounts in satoshis.

This doesn't cover the problem of how to generate the JSON parameter encoding all actual payments; this can be done with some Excel-fu and/or search-replace. I have put up an example at https://bitcoil.co.il/Sendmany-example.xlsx; the payment per share is in A1, the addresses and share counts are in columns B-C, D and E should be completed down. The last row of E is the recipients parameter in MyWallet format.

Is there a limit with "sendmany" ?
There shouldn't be, but a limitation may exist because of the interface used. The command line may have a limit on the number of characters you can use it for; when using the MyWallet GET API there is a browser limit on the characters in the URI. I have successfully used the latter to send to 88 addresses with a 3606 character URI. If the API also accepts POST it could be more scalable, but slightly harder to use.

try to avoid making double payments by accident.
One added benefit of using MyWallet as I described is that you can load it with only as many bitcoins as you intend to pay, making it much harder to make double or otherwise erroneous payments.

however big transactions might become exponentially expensive due to blockchain spam prevention.
The word "exponentially" is commonly misused to describe things which show only polynomial growth (or no asymptotic growth at all). Here is a rare example of misusing it to describe hyperbolic growth (as the total block size approaches the limit, the transaction fee has a vertical asymptote with a simple pole).
legendary
Activity: 1666
Merit: 1000
November 25, 2012, 08:51:03 AM
#5
@Sukrim - thanks...

Need to try and figure how the heck to manage a possible test payment (a la Meni) in the near future.  Thnakfully we are at less than 1000 addresses but over 100  Huh
legendary
Activity: 2618
Merit: 1006
November 25, 2012, 08:40:23 AM
#4
None that i'm aware of - however big transactions might become exponentially a lot more (thanks Meni! Wink) expensive due to blockchain spam prevention.

I'd recommend to maybe use batches of 100 transactions at once or so, not thousands.
legendary
Activity: 1666
Merit: 1000
November 25, 2012, 08:29:22 AM
#3
Is there a limit with "sendmany" ?
legendary
Activity: 2618
Merit: 1006
November 22, 2012, 03:36:01 PM
#2
Also make sure to use the "sendmany" option to avoid transaction fees + blockchain bloat. If you have any questions, please ask first before you try it out, I'm sure there are people who can assist you here. Smiley
sr. member
Activity: 800
Merit: 250
November 22, 2012, 10:30:14 AM
#1
If you're going to handle paying dividends by yourself after you get your user list, try to avoid making double payments by accident.

 Grin
Jump to: