What does the v
in vin
and vout
stand for? And is it an instance of a more general naming scheme?
1 Answer
The original Satoshi codebase used a programming style called "Hungarian notation", where variable names are prefixed with letters that indicate the data type they contain.
v
in particular stands for "vector". So vin
and vout
just mean "in vector" and "out vector", and were (and are) the variable names for the inputs and outputs of a transaction.
In UTXOs, that name sort of got inherited, and "vout index" got abbreviated to vout in certain context.
-
1
-
6Obligatory rant about the fact that Hungarian notation was meant to be used on semantic types, not actual data types, but it was massively misunderstood by large swaths of managers. You don't need the variable name to tell you that you have a string, but it is nice to have the variable name tell you whether your string has, say, gone through input validation and sanitation and is therefore safe to send into backend machinery.– ArthurCommented Jan 6, 2023 at 10:18
-
2@Arthur Unless you hope that Satoshi reads your rant here, I don't think you need to convince anyone here. Bitcoin Core no longer uses Hungarian notation as a style. Commented Jan 6, 2023 at 14:17