Bitcoin Forum
May 12, 2024, 12:25:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: is there a way to send "all remaining amount" when using pay to many?  (Read 131 times)
Red-Apple (OP)
Hero Member
*****
Offline Offline

Activity: 1470
Merit: 655


View Profile
August 20, 2019, 12:29:55 PM
 #1

i think it is easier to explain with numbers:
lets say i have 100,000 satoshi and want to pay:
- 9500 satoshi to address_1
- (automatic 500 satoshi fee)
- send remaining 90000 satoshi to address_2 (that is not in the wallet i use)

this is easy because of round numbers:
address_1, 0.00009500
address_2, 0.00090000
works but numbers are never round Tongue is there any syntax i could put in place of "0.00090000" that sends all the remaining to address_2. i tried "*" and "all", nothing worked.

--signature space for rent; sent PM--
1715473511
Hero Member
*
Offline Offline

Posts: 1715473511

View Profile Personal Message (Offline)

Ignore
1715473511
Reply with quote  #2

1715473511
Report to moderator
1715473511
Hero Member
*
Offline Offline

Posts: 1715473511

View Profile Personal Message (Offline)

Ignore
1715473511
Reply with quote  #2

1715473511
Report to moderator
No Gods or Kings. Only Bitcoin
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Rath_
aka BitCryptex
Legendary
*
Offline Offline

Activity: 1876
Merit: 3131



View Profile
August 20, 2019, 12:54:43 PM
Merited by Abdussamad (3), Red-Apple (2), bob123 (1)
 #2

works but numbers are never round Tongue is there any syntax i could put in place of "0.00090000" that sends all the remaining to address_2. i tried "*" and "all", nothing worked.

Instead of '*' and 'all', you should use '!'. Fill the 'Pay to many' box like this:

Code:
address1, amount1
address2, !

You will be able to adjust the fee. The remaining coins will be sent to the address2. There is no such thing as 'automatic 500 satoshi fee'. Your transaction fee depends on the number of inputs and outputs, number of unconfirmed transactions in the mempool and the type of address you are using.
mocacinno
Legendary
*
Offline Offline

Activity: 3388
Merit: 4922


https://merel.mobi => buy facemasks with BTC/LTC


View Profile WWW
August 20, 2019, 12:55:27 PM
Merited by hugeblack (1)
 #3

You could always use the console...
You'll need paytomany

Code:
./electrum help paytomany
usage: electrum paytomany [-h] [-v VERBOSITY]
                                    [-V VERBOSITY_SHORTCUTS]
                                    [-D ELECTRUM_PATH] [-P] [-w WALLET_PATH]
                                    [--testnet] [--regtest] [--simnet]
                                    [-f FEE] [-F FROM_ADDR] [-c CHANGE_ADDR]
                                    [--nocheck] [-u] [--rbf RBF] [-W PASSWORD]
                                    [--locktime LOCKTIME]
                                    outputs

Create a multi-output transaction.

positional arguments:
  outputs               list of ["address", amount]

optional arguments:
  -h, --help            show this help message and exit
  -f FEE, --fee FEE     Transaction fee (in BTC)
  -F FROM_ADDR, --from_addr FROM_ADDR
                        Source address (must be a wallet address; use sweep to
                        spend from non-wallet address).
  -c CHANGE_ADDR, --change_addr CHANGE_ADDR
                        Change address. Default is a spare address, or the
                        source address if it's not in the wallet
  --nocheck             Do not verify aliases
  -u, --unsigned        Do not sign transaction
  --rbf RBF             Replace-by-fee transaction
  -W PASSWORD, --password PASSWORD
                        Password
  --locktime LOCKTIME   Set locktime block number

global options:
  -v VERBOSITY          Set verbosity (log levels)
  -V VERBOSITY_SHORTCUTS
                        Set verbosity (shortcut-filter list)
  -D ELECTRUM_PATH, --dir ELECTRUM_PATH
                        electrum directory
  -P, --portable        Use local 'electrum_data' directory
  -w WALLET_PATH, --wallet WALLET_PATH
                        wallet path
  --testnet             Use Testnet
  --regtest             Use Regtest
  --simnet              Use Simnet


Do read BitCryptex's post first tough!!! He's spot on when he told you there is no such thing as an automatic fee!!! If you manually create a transaction using the paytomany console command, and you chose a "default" fee, you'll either be (grossly) overpaying, or (grossly) underpaying... So you'll either get a fast confirmation at a price that's way to high, or your transaction will get stuck (unconfirmed in the mempool of many nodes) for a potentially long time.

An other option would be to export your private keys, import them into core and use core's cli, or use coinb.in to create an unsigned transaction and sign it from electrum's console

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Red-Apple (OP)
Hero Member
*****
Offline Offline

Activity: 1470
Merit: 655


View Profile
August 20, 2019, 01:23:13 PM
 #4

There is no such thing as 'automatic 500 satoshi fee'.

by "automatic" i meant to have the value "500" (as an example) be set automatically when i set the fee to something like 1 satoshi/byte and based on size and based on the first value and the total remaining to be sent to second address.

it is against the alternative (manual) thing i was doing:
1. total - amount1
2. guess transaction size based on input/output
3. calculate fee by hand (500 in this example)
4. (result_of_1 - result_of_3) and set it for address 2
5. preview to see if i didn't have any change left
6. repeat step 2&3 until i get it right!
result: nightmare...


the exclamation mark was exactly what i was looking for. thanks.

--signature space for rent; sent PM--
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!