Bitcoin Forum
May 06, 2024, 06:48:02 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What are the theorical maximum values?  (Read 224 times)
TheWolf666 (OP)
Full Member
***
Offline Offline

Activity: 615
Merit: 154


CEO of Metaisland.gg and W.O.K Corp


View Profile WWW
March 01, 2019, 10:05:08 AM
Merited by darosior (1)
 #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.




Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
March 01, 2019, 12:43:05 PM
Merited by hugeblack (1)
 #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)
Heisenberg_Hunter
Legendary
*
Offline Offline

Activity: 1583
Merit: 1276


Heisenberg Design Services


View Profile WWW
March 01, 2019, 01:05:11 PM
Merited by dbshck (4), achow101 (2), vapourminer (1), ABCbits (1)
 #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.
buwaytress
Legendary
*
Offline Offline

Activity: 2800
Merit: 3443


Join the world-leading crypto sportsbook NOW!


View Profile
March 02, 2019, 04:15:58 PM
 #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?

██
██
██
██
██
██
██
██
██
██
██
██
██
... LIVECASINO.io    Play Live Games with up to 20% cashback!...██
██
██
██
██
██
██
██
██
██
██
██
██
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
March 02, 2019, 05: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.

HeRetiK
Legendary
*
Offline Offline

Activity: 2926
Merit: 2091


Cashback 15%


View Profile
March 05, 2019, 07: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

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
Pages: [1]
  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!