Author

Topic: What are the theorical maximum values? (Read 237 times)

legendary
Activity: 3122
Merit: 2178
Playgram - The Telegram Casino
March 05, 2019, 02:16:20 PM
#6
Also, I wonder now with lightning and possible sub-satoshi payments, what is the theoretical minimum value?

Since sub-satoshi payments are probabilistic [1] I guess this depends on the size of the integer being returned by the random function. So using 64 bit integers like currently in use for on-chain input / output amounts the smallest sub-satoshi amount transactable would be 1 / 2^64 (= 5.42 * 10^-20) satoshis. You probably could go even smaller by chaining multiple random conditionals. That's in theory though, not sure how it would look like in practice.

[1] https://en.bitcoin.it/wiki/Lightning_Network
staff
Activity: 3458
Merit: 6793
Just writing some code
March 02, 2019, 12:18:24 PM
#5
This value has been hard-coded in the bitcoin code by satoshi in the form of MAX_MONEY variable. MAX_MONEY variable is used by the node to verify that the people are not transacting an amount higher than total value of the btc.
MAX_MONEY is not consensus critical. It does not control what the actual total money supply is. That is determined mathematically by the block reward. MAX_MONEY is only there as a quick sanity check as part of the fix for the overflow bug.

why didn't they just introduce a max limit of total controlled by the private key
That would be a consensus change and a fork. Also philosophically, why should there be an arbitrary limit on how much money someone can have? Using the finite supply limit as a sanity check just makes sure that no one has more money than the finite supply.
legendary
Activity: 2968
Merit: 3684
Join the world-leading crypto sportsbook NOW!
March 02, 2019, 11:15:58 AM
#4
Thanks for that very useful answer Heisenburg. I'm wondering though, why didn't they just introduce a max limit of total controlled by the private key (in my layman mind, the "!" which makes the maximum spend minus fee already solves this problem. Why the need for MAX_MONEY variable if already so?

Also, I wonder now with lightning and possible sub-satoshi payments, what is the theoretical minimum value?
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
March 01, 2019, 08:05:11 AM
#3
Topics like this should be present in Development and Technical Discussion board. The Technical Support board is for answering topics regarding the wallet, transactions etc. Please move it to the respective boards by using the Move Button in bottom left corner of your topic.

1) what is the maximum value for a transaction. https://en.bitcoin.it/wiki/Transaction
 ...snip....
Or there are limits fixed by the blockchain storage?
Maximum bitcoins that can be transacted through a single transaction is limited to the total bitcoins produced i.e 20999999.9769 bitcoin which is approximately equal to 21 million bitcoin. This value has been hard-coded in the bitcoin code by satoshi in the form of MAX_MONEY variable. MAX_MONEY variable is used by the node to verify that the people are not transacting an amount higher than total value of the btc. If there happens to be a overflow incident like the one which took place in 2010 and produced 182 billion it would be prevented by the code. MAX_MONEY constant was introduced in the code as part of this bug probably. The code itself is present in the amount.h of the source code :

Code:
/** No amount larger than this (in satoshi) is valid */
static const CAmount MAX_MONEY = 21000000 * COIN;
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }

2) how much max a Wallet can hold. I have made tests and I could store up to 16 Billion and then it turned to negative. It is an empiric test but in reality what is the maximum limit of Bitcoin that can be holded in a wallet du to storage limitation.
You need to note that a wallet doesn't hold your coins. The coins are present in the blockchain. Your wallet just holds the private keys to spend the coins by signing a transaction. Hence as far as I know there isn't any limit set to the wallet itself.
sr. member
Activity: 279
Merit: 435
March 01, 2019, 07:43:05 AM
#2
Hi,

Quote
1) what is the maximum value for a transaction.
There is no such thing as a value per transaction, but per output. The "value out" (how is called the value spent by a transaction) of the sum of the outputs the transaction creates has to be inferior to the sum of the value of the outputs this transaction spends. Talking about max integer size, you might be interested in checking out this thread Wink .

Quote
2) how much max a Wallet can hold. I have made tests and I could store up to 16 Billion and then it turned to negative. It is an empiric test but in reality what is the maximum limit of Bitcoin that can be holded in a wallet du to storage limitation.
Sorry, I don't know the wallet code enough to answer this one. (good question)
full member
Activity: 615
Merit: 154
CEO of Metaisland.gg and W.O.K Corp
March 01, 2019, 05:05:08 AM
#1
In Theory...

1) what is the maximum value for a transaction. https://en.bitcoin.it/wiki/Transaction
 I see in the Wiki that the transactions are stored in a 9 Byte space, which is really large but in reality, if the supply of Bitcoin changed to say the same of Bytecoin for example (180 Billion) would the Bitcoin core would allow a 1 Billion BTC transaction (that's a lot of Satoshi!)? Or there are limits fixed by the blockchain storage?

2) how much max a Wallet can hold. I have made tests and I could store up to 16 Billion and then it turned to negative. It is an empiric test but in reality what is the maximum limit of Bitcoin that can be holded in a wallet du to storage limitation.



Jump to: