Bitcoin Forum
May 16, 2021, 07:12:16 AM *
News: Latest Bitcoin Core release: 0.21.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Stack size  (Read 158 times)
alkurbatov97
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
August 15, 2018, 02:52:48 PM
 #1

What is the stack size in Bitcoin Script?
1621149136
Hero Member
*
Offline Offline

Posts: 1621149136

View Profile Personal Message (Offline)

Ignore
1621149136
Reply with quote  #2

1621149136
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
bob123
Legendary
*
Offline Offline

Activity: 1526
Merit: 2328



View Profile WWW
August 15, 2018, 03:01:04 PM
Merited by ETFbitcoin (1), AdolfinWolf (1)
 #2

That's a weird question with no clear answer.
Do you get an error when signing a transaction (e.g. 'operation not valid with the current stack size'), or why are you asking this question ?

If you somehow encounter an error and want to get a detailed helpful reply, you should include every necessary information into your post.


In case of you getting 'operation not valid with the current stack size' when signing a transaction with core, you are somehow either missing private keys to sign the TX or the script verification failed for any other reason.
Are you trying to sign a multisig tx ?

alkurbatov97
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
August 15, 2018, 03:58:09 PM
 #3

Hi
Thank you for comment.
Just I read in one source that the stack size when using Bitcoin Script is limited to 16 values.
Is it so?
amaclin1
Sr. Member
****
Offline Offline

Activity: 686
Merit: 271


View Profile
August 15, 2018, 06:00:45 PM
 #4

Hi
Thank you for comment.
Just I read in one source that the stack size when using Bitcoin Script is limited to 16 values.
Is it so?

No, this is definetely wrong

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
HeRetiK
Legendary
*
Offline Offline

Activity: 1834
Merit: 1505


the forkings will continue until morale improves


View Profile
August 16, 2018, 10:09:03 AM
Merited by ETFbitcoin (1)
 #5

The maximum stack size for a Bitcoin script to be still considered valid is 1000:

Code:
// Maximum number of values on script interpreter stack
static const int MAX_STACK_SIZE = 1000;


Depending on your script you are more likely to run into the maximum script size in bytes though:

Code:
// Maximum script length in bytes
static const int MAX_SCRIPT_SIZE = 10000;


For reference:

https://github.com/bitcoin/bitcoin/blob/78dae8caccd82cfbfd76557f1fb7d7557c7b5edb/src/script/script.h

https://github.com/bitcoin/bitcoin/blob/78dae8caccd82cfbfd76557f1fb7d7557c7b5edb/src/script/interpreter.cpp

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!