Bitcoin Forum
November 09, 2024, 09:40:35 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3]  All
  Print  
Author Topic: Zero fee transaction  (Read 4148 times)
bitterbit (OP)
Member
**
Offline Offline

Activity: 101
Merit: 12


View Profile
June 19, 2016, 07:05:08 AM
 #41

The last result I had is so dissatisfactory
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
June 19, 2016, 03:22:38 PM
Last edit: June 19, 2016, 03:42:23 PM by DannyHamilton
 #42

The last result I had is so dissatisfactory

According to the transaction that you posted, it looks like you are trying to spend a 0.00005775 BTC output that was sent to 15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd

Although I'm not familiar with the specific error you are reporting, "Operation not valid with the current stack size", I do see three possible problems with the transaction you built.

First of all you only funded the transaction using a single 0.00005775 BTC unspent output as an input, but then you tried to create a new 0.00136988 BTC output.  In order to be a valid transaction, the sum of the output values that you create must be less than or equal to the sum of the values of the inputs that you use.  0.00136988 IS NOT less than or equal to  0.00005775. If the sum of the of the output values is less than the sum of the inputs, then the remaining value is a transaction fee for the miners.

Another other potential problem would be if you do not have the private key for 15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd in your wallet.  Without that private key, the wallet software would be unable to sign the transaction. Are you certain that the wallet you are using has the private key for that address?  If the wallet doesn't have the private key, then you can supply the private key in the parameters that you send to signrawtransaction.

And finally, if you haven't yet synchronized your Bitcoin Core wallet with the blockchain, then it won't be able to look up transaction ID 48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf to determine which private key to use for the signature.  In that case, you'll need to supply the "scriptPubKey" in the parameters that you send to signrawtransaction.

Note that if the wallet doesn't have the private key AND you also haven't synchronized the blockchain, then you can still sign the transaction with signrawtransaction as long as you supply BOTH the "scriptPubKey" and the private key, along with the raw transaction in the parameters that you send to signrawtransaction.

Usage details:
Quote
signrawtransaction <hexstring> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...]

Where:
  • hexstring is the rawtransaction represented in hexadecimal
  • txid is the hash value represented in hexadecimal of the transaction containing the unspent output that you are using to fund the transaction and for which you will be supplying the scriptPubKey (in this case that would be 48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf)
  • n is the index indicating which unspent output from the previous transaction is being used as an input in this transaction (in this case that would be 0)
  • hex is the scriptPubKey value represented in hexadecimal from the unspent output that is being used as an input.
  • privatekey1 is the private key in WIF (wallet import format) that you will use to sign the transaction (in this case that would be the private key associated with address 15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd
bitterbit (OP)
Member
**
Offline Offline

Activity: 101
Merit: 12


View Profile
June 20, 2016, 05:10:40 AM
 #43

The last result I had is so dissatisfactory

According to the transaction that you posted, it looks like you are trying to spend a 0.00005775 BTC output that was sent to 15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd

Although I'm not familiar with the specific error you are reporting, "Operation not valid with the current stack size", I do see three possible problems with the transaction you built.

First of all you only funded the transaction using a single 0.00005775 BTC unspent output as an input, but then you tried to create a new 0.00136988 BTC output.  In order to be a valid transaction, the sum of the output values that you create must be less than or equal to the sum of the values of the inputs that you use.  0.00136988 IS NOT less than or equal to  0.00005775. If the sum of the of the output values is less than the sum of the inputs, then the remaining value is a transaction fee for the miners.

Another other potential problem would be if you do not have the private key for 15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd in your wallet.  Without that private key, the wallet software would be unable to sign the transaction. Are you certain that the wallet you are using has the private key for that address?  If the wallet doesn't have the private key, then you can supply the private key in the parameters that you send to signrawtransaction.

And finally, if you haven't yet synchronized your Bitcoin Core wallet with the blockchain, then it won't be able to look up transaction ID 48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf to determine which private key to use for the signature.  In that case, you'll need to supply the "scriptPubKey" in the parameters that you send to signrawtransaction.

Note that if the wallet doesn't have the private key AND you also haven't synchronized the blockchain, then you can still sign the transaction with signrawtransaction as long as you supply BOTH the "scriptPubKey" and the private key, along with the raw transaction in the parameters that you send to signrawtransaction.

Usage details:
Quote
signrawtransaction <hexstring> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...]

Where:
  • hexstring is the rawtransaction represented in hexadecimal
  • txid is the hash value represented in hexadecimal of the transaction containing the unspent output that you are using to fund the transaction and for which you will be supplying the scriptPubKey (in this case that would be 48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf)
  • n is the index indicating which unspent output from the previous transaction is being used as an input in this transaction (in this case that would be 0)
  • hex is the scriptPubKey value represented in hexadecimal from the unspent output that is being used as an input.
  • privatekey1 is the private key in WIF (wallet import format) that you will use to sign the transaction (in this case that would be the private key associated with address 15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd


oh well!
As a matter of fact
I'm trying to spend 0.00136988 sent to the address : 1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo If there's a way I con do it or I got the whole spending scenario wrong?
FinanceUS
Member
**
Offline Offline

Activity: 68
Merit: 10


View Profile
June 20, 2016, 06:52:39 AM
 #44

You can create zero fee transactions but I doubt how long, if even so, it will be successfully included in a block.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
June 20, 2016, 11:23:02 AM
 #45

oh well!
As a matter of fact
I'm trying to spend 0.00136988 sent to the address : 1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo If there's a way I con do it or I got the whole spending scenario wrong?

If you look at the transaction that created the output you are trying to spend, you'll see that it has 2 outputs.  You have to specify which output you want to spend.

Quote
getrawtransaction 48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf 1

{
  "txid": "48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf",
  "size": 373,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "3e7b1a8dbf026d77e62bb896d560dca9b27a576340119fee7d16492d2ace32a4",
      "vout": 0,
      "sequence": 4294967295
    },
    {
      "txid": "af7d3ded1b8ccd2138bf35a7154f389fd90ac5af2beb73f5b8849d2df69bb572",
      "vout": 1,
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00005775,
      "n": 0,

      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3023e5def45112164a3519728cc27f975e6e39e1 OP_EQUALVERIFY OP_CHECKSIG",
        "type": "pubkeyhash",
        "addresses": [
          "15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd"
        ]
      }
    },
    {
      "value": 0.00136988,
      "n": 1,

      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 94b9e905ee5bf75f0bb9b90f1383689f5cdc3a7e OP_EQUALVERIFY OP_CHECKSIG",
        "type": "pubkeyhash",
        "addresses": [
          "1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo"
        ]
      }
    }
  ],
  "blockhash": "0000000000000000055d59425a4f802b41bc1cbf3437329525ab5d5e6b4687a6",
  "confirmations": 137,
}


If you have the private key for 1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo in your wallet, then this should work:

Code:
createrawtransaction [{\"txid\":\"48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf\",\"vout\":1}] {\"1DAbnF1nDhLWkkMKVqKNHRJF39fwfjdrfB\":0.00136988}

Which should result in a transaction that looks like this:
0100000001bf5fb8dc3884edc6e8c4d1e028624975b5e184deda1bcd6d77b312d1547dd54801000 00000ffffffff011c170200000000001976a914857249351a591cec53e19c9bd8320370b1f4746b 88ac00000000

The difference between this transaction and the one you are trying to sign is that this one is spending the output (vout) where n=1, and you were trying to spend the output (vout) where n=0.
bitterbit (OP)
Member
**
Offline Offline

Activity: 101
Merit: 12


View Profile
June 20, 2016, 03:31:52 PM
 #46

oh well!
As a matter of fact
I'm trying to spend 0.00136988 sent to the address : 1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo If there's a way I con do it or I got the whole spending scenario wrong?

If you look at the transaction that created the output you are trying to spend, you'll see that it has 2 outputs.  You have to specify which output you want to spend.

Quote
getrawtransaction 48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf 1

{
  "txid": "48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf",
  "size": 373,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "3e7b1a8dbf026d77e62bb896d560dca9b27a576340119fee7d16492d2ace32a4",
      "vout": 0,
      "sequence": 4294967295
    },
    {
      "txid": "af7d3ded1b8ccd2138bf35a7154f389fd90ac5af2beb73f5b8849d2df69bb572",
      "vout": 1,
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 0.00005775,
      "n": 0,

      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 3023e5def45112164a3519728cc27f975e6e39e1 OP_EQUALVERIFY OP_CHECKSIG",
        "type": "pubkeyhash",
        "addresses": [
          "15PYSSX8MTrmPsxkdWSZbZfoYL3JPV1BPd"
        ]
      }
    },
    {
      "value": 0.00136988,
      "n": 1,

      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 94b9e905ee5bf75f0bb9b90f1383689f5cdc3a7e OP_EQUALVERIFY OP_CHECKSIG",
        "type": "pubkeyhash",
        "addresses": [
          "1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo"
        ]
      }
    }
  ],
  "blockhash": "0000000000000000055d59425a4f802b41bc1cbf3437329525ab5d5e6b4687a6",
  "confirmations": 137,
}


If you have the private key for 1EZPifMcq31gXsMM8s4RBDy4T5kkAJtTpo in your wallet, then this should work:

Code:
createrawtransaction [{\"txid\":\"48d57d54d112b3776dcd1bdade84e1b575496228e0d1c4e8c6ed8438dcb85fbf\",\"vout\":1}] {\"1DAbnF1nDhLWkkMKVqKNHRJF39fwfjdrfB\":0.00136988}

Which should result in a transaction that looks like this:
0100000001bf5fb8dc3884edc6e8c4d1e028624975b5e184deda1bcd6d77b312d1547dd54801000 00000ffffffff011c170200000000001976a914857249351a591cec53e19c9bd8320370b1f4746b 88ac00000000

The difference between this transaction and the one you are trying to sign is that this one is spending the output (vout) where n=1, and you were trying to spend the output (vout) where n=0.


Thank u for the follow up>i was able to sign the transaction but as soon as I tried to broadcast it this happened :
15:29:26

66: mempool min fee not met (code -26)

which in my opinion is asking for the fee which again defies my very urgent motive ie to create zero fee transaction.How to proceed from this step?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
June 20, 2016, 04:06:50 PM
 #47

Thank u for the follow up>i was able to sign the transaction but as soon as I tried to broadcast it this happened :
15:29:26

66: mempool min fee not met (code -26)

which in my opinion is asking for the fee which again defies my very urgent motive ie to create zero fee transaction.How to proceed from this step?

So, you have now successfully accomplished what we set out to do: Create a zero fee transaction.

Now it looks like you are trying to find a way to broadcast this transaction.

Unfortunately, because it is expected that most peers will refuse to relay any transaction that doesn't have a sufficient fee, and it is assumed that miners won't bother confirming your transaction if it doesn't have a sufficient fee, the default installation of Bitcoin Core is configured warn you and refuse to broadcast it.

It's not very useful to broadcast a transaction to peers that are simply going to ignore it. Most of the network and miners will never even hear about it.

So, keep in mind that even if you change the configuration on your Bitcoin Core to allow it to broadcast free transactions, all of your connected peers might just ignore the transaction.

With that in mind:

If you have an arrangement with a mining pool to confirm your transactions, you could just send the transaction directly to them (you'll need to contact the pool to find out how they'd like to receive the transaction).

If you really want to try broadcasting your transaction from Bitcoin Core, I believe you can use bitcoin.conf to change some of the fee restriction settings in Bitcoin Core.

You could also try using an API from a service that is willing to broadcast signed transactions for you.  There are a few websites that will do that:

bitterbit (OP)
Member
**
Offline Offline

Activity: 101
Merit: 12


View Profile
June 20, 2016, 04:42:06 PM
 #48

Thank u for the follow up>i was able to sign the transaction but as soon as I tried to broadcast it this happened :
15:29:26

66: mempool min fee not met (code -26)

which in my opinion is asking for the fee which again defies my very urgent motive ie to create zero fee transaction.How to proceed from this step?

So, you have now successfully accomplished what we set out to do: Create a zero fee transaction.

Now it looks like you are trying to find a way to broadcast this transaction.

Unfortunately, because it is expected that most peers will refuse to relay any transaction that doesn't have a sufficient fee, and it is assumed that miners won't bother confirming your transaction if it doesn't have a sufficient fee, the default installation of Bitcoin Core is configured warn you and refuse to broadcast it.

It's not very useful to broadcast a transaction to peers that are simply going to ignore it. Most of the network and miners will never even hear about it.

So, keep in mind that even if you change the configuration on your Bitcoin Core to allow it to broadcast free transactions, all of your connected peers might just ignore the transaction.

With that in mind:

If you have an arrangement with a mining pool to confirm your transactions, you could just send the transaction directly to them (you'll need to contact the pool to find out how they'd like to receive the transaction).

If you really want to try broadcasting your transaction from Bitcoin Core, I believe you can use bitcoin.conf to change some of the fee restriction settings in Bitcoin Core.

You could also try using an API from a service that is willing to broadcast signed transactions for you.  There are a few websites that will do that:



Thank u for all the info.
I really appreciate it.
abugseuf
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
June 21, 2016, 11:35:45 AM
 #49

where is the zero fee transection i really need itl.
Pages: « 1 2 [3]  All
  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!