Bitcoin-cli createrawtransaction with 3 outputs example











up vote
1
down vote

favorite












Is this possible to do?



I am trying to create a transaction with 1 input that will have 3 outputs.



I tried:



bitcoin-cli createrawtransaction "[{"txid":"b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e","vout":1}]" "[{"2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN":0.00989748, "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn":0.23247816, "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq":0.0001}]"


But get an error:



error code: -8
error message:
Invalid parameter, key-value pair must contain exactly one key


I don't understand what I'm doing wrong since the inputs and outputs both take in an array of values.



Any ideas?



This is version 0.17.0.



Here's the pretty print json



I'm pretty confident that there is no syntax issue.



"[
{
"txid": "b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e",
"vout": 1
}
]"
"[
{
"2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN": 0.00989748,
"2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn": 0.23247816,
"2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq": 0.0001
}
]"









share|improve this question




























    up vote
    1
    down vote

    favorite












    Is this possible to do?



    I am trying to create a transaction with 1 input that will have 3 outputs.



    I tried:



    bitcoin-cli createrawtransaction "[{"txid":"b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e","vout":1}]" "[{"2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN":0.00989748, "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn":0.23247816, "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq":0.0001}]"


    But get an error:



    error code: -8
    error message:
    Invalid parameter, key-value pair must contain exactly one key


    I don't understand what I'm doing wrong since the inputs and outputs both take in an array of values.



    Any ideas?



    This is version 0.17.0.



    Here's the pretty print json



    I'm pretty confident that there is no syntax issue.



    "[
    {
    "txid": "b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e",
    "vout": 1
    }
    ]"
    "[
    {
    "2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN": 0.00989748,
    "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn": 0.23247816,
    "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq": 0.0001
    }
    ]"









    share|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Is this possible to do?



      I am trying to create a transaction with 1 input that will have 3 outputs.



      I tried:



      bitcoin-cli createrawtransaction "[{"txid":"b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e","vout":1}]" "[{"2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN":0.00989748, "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn":0.23247816, "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq":0.0001}]"


      But get an error:



      error code: -8
      error message:
      Invalid parameter, key-value pair must contain exactly one key


      I don't understand what I'm doing wrong since the inputs and outputs both take in an array of values.



      Any ideas?



      This is version 0.17.0.



      Here's the pretty print json



      I'm pretty confident that there is no syntax issue.



      "[
      {
      "txid": "b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e",
      "vout": 1
      }
      ]"
      "[
      {
      "2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN": 0.00989748,
      "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn": 0.23247816,
      "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq": 0.0001
      }
      ]"









      share|improve this question















      Is this possible to do?



      I am trying to create a transaction with 1 input that will have 3 outputs.



      I tried:



      bitcoin-cli createrawtransaction "[{"txid":"b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e","vout":1}]" "[{"2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN":0.00989748, "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn":0.23247816, "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq":0.0001}]"


      But get an error:



      error code: -8
      error message:
      Invalid parameter, key-value pair must contain exactly one key


      I don't understand what I'm doing wrong since the inputs and outputs both take in an array of values.



      Any ideas?



      This is version 0.17.0.



      Here's the pretty print json



      I'm pretty confident that there is no syntax issue.



      "[
      {
      "txid": "b0d6607323d5dadcd67dd1b5b6d6e5f08b70c45d187c8cf17ebfa00f9c0fb65e",
      "vout": 1
      }
      ]"
      "[
      {
      "2Mxmxo19LaqUePqkshcYQDzwW8SY6CpxzjN": 0.00989748,
      "2N1ozs19uHsk2maPA5PiK8TEZQP8HfTd4Zn": 0.23247816,
      "2NDgJmx7PykJRMK4QKTqUrfC6ewmccaq6fq": 0.0001
      }
      ]"






      json-rpc bitcoin-cli createrawtransaction






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 6:30

























      asked Nov 11 at 6:25









      mocode10

      103




      103






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          You need to use (simplified notation) [{addr:amount},{addr:amount}] for the outputs, not [{addr:amount,addr:amount}]. This is to permit multiple outputs with the same address (which wouldn't be valid JSON in your assumed syntax).



          A simpler alternative also exists, namely {addr:amount,addr:amount}.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "308"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f80905%2fbitcoin-cli-createrawtransaction-with-3-outputs-example%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            You need to use (simplified notation) [{addr:amount},{addr:amount}] for the outputs, not [{addr:amount,addr:amount}]. This is to permit multiple outputs with the same address (which wouldn't be valid JSON in your assumed syntax).



            A simpler alternative also exists, namely {addr:amount,addr:amount}.






            share|improve this answer

























              up vote
              2
              down vote



              accepted










              You need to use (simplified notation) [{addr:amount},{addr:amount}] for the outputs, not [{addr:amount,addr:amount}]. This is to permit multiple outputs with the same address (which wouldn't be valid JSON in your assumed syntax).



              A simpler alternative also exists, namely {addr:amount,addr:amount}.






              share|improve this answer























                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                You need to use (simplified notation) [{addr:amount},{addr:amount}] for the outputs, not [{addr:amount,addr:amount}]. This is to permit multiple outputs with the same address (which wouldn't be valid JSON in your assumed syntax).



                A simpler alternative also exists, namely {addr:amount,addr:amount}.






                share|improve this answer












                You need to use (simplified notation) [{addr:amount},{addr:amount}] for the outputs, not [{addr:amount,addr:amount}]. This is to permit multiple outputs with the same address (which wouldn't be valid JSON in your assumed syntax).



                A simpler alternative also exists, namely {addr:amount,addr:amount}.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 11 at 7:45









                Pieter Wuille

                44.6k390151




                44.6k390151






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Bitcoin Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f80905%2fbitcoin-cli-createrawtransaction-with-3-outputs-example%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Bressuire

                    Vorschmack

                    Quarantine