Skip to content

Wonder about the terms of "input", "output". #94

Open

Description

@youngminpark2559

At this page:
https://github.com/youngmtool/ProgrammingBlockchain/blob/master/bitcoin_transfer/spend_your_coin.md

At this sentence:
/Generate a TxOut for hallOfTheMakers.
TxOut hallOfTheMakersTxOut = new TxOut()

This code is making 2 TxOuts.
But under my understanding, since "in" and "out" in the transaction is TxIn and TxOut, one transaction can have one TxIn and one TxOut.
But each TxIn and TxOut can have multiple inputs and outputs.
See the illustration, TransactionSendReceiveCoins.png, I draw:
https://youngmtool.gitbooks.io/csharpdotnetconceptsandillustrations/blockchain.html

Can I say that the above code is making 2 outputs rather than 2 TxOut?

Activity

  1. nopara73 commented on Nov 23, 2017

    @nopara73
    Contributor

    But under my understanding, since "in" and "out" in the transaction is TxIn and TxOut, one transaction can have one TxIn and one TxOut.

    That's not correct. I think your confusion comes from how you read json and how Bitcoin Core traditionally named its rpc output. in and out are actually arrays. It would be more correct to call the arrays ins and outs.

    Can I say that the above code is making 2 outputs rather than 2 TxOut?

    TxOut, out, output are synonyms. I'd keep it TxOut, since that's what NBitcoin uses.

  2. youngminpark2559 commented on Nov 24, 2017

    @youngminpark2559
    ContributorAuthor

    Of the sentence "Bitcoin Core traditionally named its rpc output", traditionally?, it means the representation of the transaction in the JSON is now different? Or the representation of the transaction in the JSON, under this sentence: scriptPubKeys of the "normal" TxOuts and the scriptPubKey of the TxOut with the message, at this page : https://github.com/youngmtool/ProgrammingBlockchain/blob/master/bitcoin_transfer/spend_your_coin.md, is still identical with the up to date format?

    And again, of above JSON representation of the transaction, so that you mean I can call the key "in" as "array ins"?
    But why is "in" pluralized? Under my understanding, one transaction can have only one "in". Is it wrong?

    I've never seen the term indicating "in" or "out" in this book, all the terms such as TxOut, output, out indicate each object holding value and ScriptPubKey in the array, so I think "in" and "out" are needed to be mentioned as a term.

  3. NicolasDorier commented on Nov 24, 2017

    @NicolasDorier
    Collaborator

    I personally prefer TxOut than output when describing code.

  4. NicolasDorier commented on Nov 24, 2017

    @NicolasDorier
    Collaborator

    the ins pluralized come from core as well.

  5. youngminpark2559 commented on Nov 24, 2017

    @youngminpark2559
    ContributorAuthor

    @NicolasDorier
    But what do you call for "out" as a term for key in a transaction because "out" is the term which is already used for indicating TxOut and output?

    Bitcoin core, does it mean the upgraded new version of Bitcoin?
    Anyway, do you mean that in Bitcoin core multiple "in" in a transaction, like above my wondering not meaning each object in the array which is keyed as "in", can be come?

  6. NicolasDorier commented on Nov 30, 2017

    @NicolasDorier
    Collaborator

    out == output == TxOut. in == input == TxIn. Bitcoin Core is software implementing Bitcoin protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions