Bitcoin Forum
April 25, 2019, 09:03:54 AM *
News: Latest Bitcoin Core release: 0.17.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [idea] shared payments  (Read 785 times)
icreator
Legendary
*
Offline Offline

Activity: 1344
Merit: 1002



View Profile WWW
October 02, 2014, 04:17:51 AM
 #1

(translated with Yandex - http://translate.yandex.ru/)

There is a need in one payment to stretch on many addresses with different weight ratios

now you have to use third party services - if part and large lists

what if in the client to create this opportunity?

do the so-called shared address - in which is recorded the address list with weighting factors:

Code:
shadrr_list = { "addr1": 2, "addr2": 0.33, ... }

for this make in API:
Code:
# create and save in wallet.dat list, so to change this list could
shaddr = makesharedaddress( shaddr_list, label )
# moreover creates an address on 1 character longer with the addition of 'S':
shaddr --> 'S1NilT.....13Gfas'
len(shaddr ) --> 35

To send all divided payments call the API command:
Code:
sendshared( shaddr, amount )

the body of the function (send divided payments) about this
Code:
################## on python
def sendshared( shaddr, amount ):
  # calc sum
  sum = 0.0
  for v in shaddrs:
    sum += v

  # recalc amo_outs
  list_out = {}
  for (k, v) in shaddrs.iteritems():
    list_out[k] = round(amount *v / sum, 8)

  sum_out = 0.0
  for v in list_out:
    sum_out += v
  diff = sum - sum_out
  # and to stretch the difference between 0.00000001 accidentally addresses
  while diff>0:
    diff -= 0.00000001
    list_out[random_key[list_out]] += 0.00000001

  return connection.sendmany(list_out)
#################

origin:
https://bitcointalk.org/index.php?topic=807172.msg9049742

Erachain Blockchain is fully ready for use Digital Ecosystem based on blockchain technology for business and government with low transaction costs, identification and built-in functions.
+Decentralized exchange of tokens in Erachain
1556183034
Hero Member
*
Offline Offline

Posts: 1556183034

View Profile Personal Message (Offline)

Ignore
1556183034
Reply with quote  #2

1556183034
Report to moderator
100% New Software
PC, Mac, Android, & HTML5 Clients
Krill Rakeback
Low Rake
Bitcoin Poker 3.0
Bad Beat Jackpot
SwC Poker Relaunch
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1556183034
Hero Member
*
Offline Offline

Posts: 1556183034

View Profile Personal Message (Offline)

Ignore
1556183034
Reply with quote  #2

1556183034
Report to moderator
1556183034
Hero Member
*
Offline Offline

Posts: 1556183034

View Profile Personal Message (Offline)

Ignore
1556183034
Reply with quote  #2

1556183034
Report to moderator
1556183034
Hero Member
*
Offline Offline

Posts: 1556183034

View Profile Personal Message (Offline)

Ignore
1556183034
Reply with quote  #2

1556183034
Report to moderator
seoincorporation
Legendary
*
Offline Offline

Activity: 1330
Merit: 1345


BtcBoss


View Profile
October 02, 2014, 05:37:40 PM
 #2

I have a bash script for this, it works with curl and Blockchain API

Code:
#!/bin/bash
#Guid
gu="xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"
#Blockchain password
pas="xxxxxxxxxx"
green="1LuckyG4tMMZf64j6ea7JhCz7sDpk6vdcS"
yellow="1LuckyY9fRzcJre7aou7ZhWVXktxjjBb9S"
red="1LuckyR1fFHEsXYyx5QK4UFzv3PEAepPMK"
BTCg="250000"
BTCy="150000"
BTCr="100000"
echo ""
curl "https://blockchain.info/merchant/$gu/sendmany?password=$pas&recipients=%7B%22$green%22%3A$BTCg%2C%22$yellow%22%3A$BTCy%2C%22$red%22%3A$BTCr%7D&shared=false&fee=10000"
echo ""

.BitDice.               ▄▄███▄▄
           ▄▄██▀▀ ▄ ▀▀██▄▄
      ▄▄█ ▀▀  ▄▄█████▄▄  ▀▀ █▄▄
  ▄▄██▀▀     ▀▀ █████ ▀▀     ▀▀██▄▄
██▀▀ ▄▄██▀      ▀███▀      ▀██▄▄ ▀▀██
██  ████▄▄       ███       ▄▄████  ██
██  █▀▀████▄▄  ▄█████▄  ▄▄████▀▀█  ██
██  ▀     ▀▀▀███████████▀▀▀     ▀  ██
             ███████████
██  ▄     ▄▄▄███████████▄▄▄     ▄  ██
██  █▄▄████▀▀  ▀█████▀  ▀▀████▄▄█  ██
██  ████▀▀       ███       ▀▀████  ██
██▄▄ ▀▀██▄      ▄███▄      ▄██▀▀ ▄▄██
  ▀▀██▄▄     ▄▄ █████ ▄▄     ▄▄██▀▀
      ▀▀█ ▄▄  ▀▀█████▀▀  ▄▄ █▀▀
           ▀▀██▄▄ ▀ ▄▄██▀▀
               ▀▀███▀▀
        ▄▄███████▄▄
     ▄███████████████▄
    ████▀▀       ▀▀████
   ████▀           ▀████
   ████             ████
   ████ ▄▄▄▄▄▄▄▄▄▄▄ ████
▄█████████████████████████▄
██████████▀▀▀▀▀▀▀██████████
████                   ████
████                   ████
████                   ████
████                   ████
████                   ████
████▄                 ▄████
████████▄▄▄     ▄▄▄████████
  ▀▀▀█████████████████▀▀▀
        ▀▀▀█████▀▀▀
▄▄████████████████████████████████▄▄
██████████████████████████████████████
█████                            █████
█████                            █████
█████                            █████
█████                            █████
█████                     ▄▄▄▄▄▄▄▄▄▄
█████                   ▄█▀▀▀▀▀▀▀▀▀▀█▄
█████                   ██          ██
█████                   ██          ██
█████                   ██          ██
██████████████████▀▀███ ██          ██
 ████████████████▄  ▄██ ██          ██
   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ██          ██
             ██████████ ██          ██
           ▄███████████ ██████▀▀██████
          █████████████  ▀████▄▄████▀
[/]
icreator
Legendary
*
Offline Offline

Activity: 1344
Merit: 1002



View Profile WWW
October 02, 2014, 06:20:43 PM
 #3

It may do any programmer  but not end user!

Erachain Blockchain is fully ready for use Digital Ecosystem based on blockchain technology for business and government with low transaction costs, identification and built-in functions.
+Decentralized exchange of tokens in Erachain
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!