Script Bitcoin represent number > 16 The 2019 Stack Overflow Developer Survey Results Are InHow do I read a script? How does the processor separate “data” from “commands”?Maximum number of op_codes in scriptAny Innovations in altcoin tech for Bitcoin’s Script language?Bitcoin library vs script to develop applicationConvert plaintext script into hex-encoded script in pythonWhy does this script return an error ?Decode Input-Script NumberBitcoin's script expressivityError while sending transaction with script OP_TRUE (Script evaluated without error but finished with a false/empty top stack element)Sending P2SH transaction with non-standard script

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Relationship between Gromov-Witten and Taubes' Gromov invariant

Mathematics of imaging the black hole

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

What do these terms in Caesar's Gallic wars mean?

Falsification in Math vs Science

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Is it safe to harvest rainwater that fell on solar panels?

Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

Is an up-to-date browser secure on an out-of-date OS?

What's the name of these plastic connectors

APIPA and LAN Broadcast Domain

What is preventing me from simply constructing a hash that's lower than the current target?

Does HR tell a hiring manager about salary negotiations?

Can withdrawing asylum be illegal?

What is the motivation for a law requiring 2 parties to consent for recording a conversation

Why can't devices on different VLANs, but on the same subnet, communicate?

Button changing its text & action. Good or terrible?

Are spiders unable to hurt humans, especially very small spiders?

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

How to notate time signature switching consistently every measure

If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?



Script Bitcoin represent number > 16



The 2019 Stack Overflow Developer Survey Results Are InHow do I read a script? How does the processor separate “data” from “commands”?Maximum number of op_codes in scriptAny Innovations in altcoin tech for Bitcoin’s Script language?Bitcoin library vs script to develop applicationConvert plaintext script into hex-encoded script in pythonWhy does this script return an error ?Decode Input-Script NumberBitcoin's script expressivityError while sending transaction with script OP_TRUE (Script evaluated without error but finished with a false/empty top stack element)Sending P2SH transaction with non-standard script










2















I'm studying Script language, but I don't understand How can I rappresent the number > 16, for instance 210



I want to do a simple sum



OP_10 210 OP_ADD


how I have to represent 210?
I'm trying with OP_PUSHDATA1 without lucky.










share|improve this question


























    2















    I'm studying Script language, but I don't understand How can I rappresent the number > 16, for instance 210



    I want to do a simple sum



    OP_10 210 OP_ADD


    how I have to represent 210?
    I'm trying with OP_PUSHDATA1 without lucky.










    share|improve this question
























      2












      2








      2








      I'm studying Script language, but I don't understand How can I rappresent the number > 16, for instance 210



      I want to do a simple sum



      OP_10 210 OP_ADD


      how I have to represent 210?
      I'm trying with OP_PUSHDATA1 without lucky.










      share|improve this question














      I'm studying Script language, but I don't understand How can I rappresent the number > 16, for instance 210



      I want to do a simple sum



      OP_10 210 OP_ADD


      how I have to represent 210?
      I'm trying with OP_PUSHDATA1 without lucky.







      transactions bitcoin-core development script






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      monkeyUsermonkeyUser

      1637




      1637




















          2 Answers
          2






          active

          oldest

          votes


















          3














          You only need to use OP_PUSHDATA1 if you are trying to push more than 75 bytes of data onto the stack.



          For pushing smaller sized values onto the stack, you can use the opcodes 0x01 to 0x4b to indicate the number of bytes being pushed. Thus, to push a single byte of value 210 (0xD2) onto the stack, you would use the byte sequence 0x01 0xd2.



          To push a 16-bit number, such as 1000 onto the stack, you would use the sequence of bytes 0x02 0xe8 0x03. Note that little-endian byte ordering is used. You can do similarly for a 24-bit number, or 32-bit number.



          The minimum size should always be used when pushing a value - meaning the most significant byte of the pushed value should never be zero.



          The value pushed will internally be zero-extended to a represent a 32-bit signed integer. All of the numeric operations in bitcoin script are limited to 32-bit integers. The result returned by a numeric operation can be treated as a signed 64-bit value, but values which overflow the 32-bit integer range may not be used in subsequent numeric operation.




          On OP_PUSHDATA1, this is used for pushing arbitrary binary data onto the stack which may be used as arguments for operations such as OP_SHA256. This works by having the first byte of the sequence being OP_PUSHDATA1, the second byte being the length of the pushed data, and the remaining bytes being the content. For data more than 255 bytes, OP_PUSHDATA2 is used, where the second and third bytes of the sequence represent the length, and so on. The minimum size rule applies to all of the kinds of pushes, including that you should not try to push a single byte <=16 onto the stack using 2 bytes, but should instead use the OP_N single-byte opcodes.






          share|improve this answer






























            1














            To push data to the stack, if there is no opcode (i.e. there is no opcode for the number 210, but there are for the numbers 1-16: OP_1 - OP_16), you need to provide a push op. Since 210 can be represented in a single byte:



            OP_10 0x01 210 OP_ADD
            ^ ^ ^ ^
            | | | | pop the top 2 items, add, and return result
            | | | Push number 210 to the stack
            | | The next 1 byte is pushed to the stack
            | Push 10 to the stack


            See https://en.bitcoin.it/wiki/Script#Constants






            share|improve this answer

























              Your Answer








              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "308"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f85989%2fscript-bitcoin-represent-number-16%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              3














              You only need to use OP_PUSHDATA1 if you are trying to push more than 75 bytes of data onto the stack.



              For pushing smaller sized values onto the stack, you can use the opcodes 0x01 to 0x4b to indicate the number of bytes being pushed. Thus, to push a single byte of value 210 (0xD2) onto the stack, you would use the byte sequence 0x01 0xd2.



              To push a 16-bit number, such as 1000 onto the stack, you would use the sequence of bytes 0x02 0xe8 0x03. Note that little-endian byte ordering is used. You can do similarly for a 24-bit number, or 32-bit number.



              The minimum size should always be used when pushing a value - meaning the most significant byte of the pushed value should never be zero.



              The value pushed will internally be zero-extended to a represent a 32-bit signed integer. All of the numeric operations in bitcoin script are limited to 32-bit integers. The result returned by a numeric operation can be treated as a signed 64-bit value, but values which overflow the 32-bit integer range may not be used in subsequent numeric operation.




              On OP_PUSHDATA1, this is used for pushing arbitrary binary data onto the stack which may be used as arguments for operations such as OP_SHA256. This works by having the first byte of the sequence being OP_PUSHDATA1, the second byte being the length of the pushed data, and the remaining bytes being the content. For data more than 255 bytes, OP_PUSHDATA2 is used, where the second and third bytes of the sequence represent the length, and so on. The minimum size rule applies to all of the kinds of pushes, including that you should not try to push a single byte <=16 onto the stack using 2 bytes, but should instead use the OP_N single-byte opcodes.






              share|improve this answer



























                3














                You only need to use OP_PUSHDATA1 if you are trying to push more than 75 bytes of data onto the stack.



                For pushing smaller sized values onto the stack, you can use the opcodes 0x01 to 0x4b to indicate the number of bytes being pushed. Thus, to push a single byte of value 210 (0xD2) onto the stack, you would use the byte sequence 0x01 0xd2.



                To push a 16-bit number, such as 1000 onto the stack, you would use the sequence of bytes 0x02 0xe8 0x03. Note that little-endian byte ordering is used. You can do similarly for a 24-bit number, or 32-bit number.



                The minimum size should always be used when pushing a value - meaning the most significant byte of the pushed value should never be zero.



                The value pushed will internally be zero-extended to a represent a 32-bit signed integer. All of the numeric operations in bitcoin script are limited to 32-bit integers. The result returned by a numeric operation can be treated as a signed 64-bit value, but values which overflow the 32-bit integer range may not be used in subsequent numeric operation.




                On OP_PUSHDATA1, this is used for pushing arbitrary binary data onto the stack which may be used as arguments for operations such as OP_SHA256. This works by having the first byte of the sequence being OP_PUSHDATA1, the second byte being the length of the pushed data, and the remaining bytes being the content. For data more than 255 bytes, OP_PUSHDATA2 is used, where the second and third bytes of the sequence represent the length, and so on. The minimum size rule applies to all of the kinds of pushes, including that you should not try to push a single byte <=16 onto the stack using 2 bytes, but should instead use the OP_N single-byte opcodes.






                share|improve this answer

























                  3












                  3








                  3







                  You only need to use OP_PUSHDATA1 if you are trying to push more than 75 bytes of data onto the stack.



                  For pushing smaller sized values onto the stack, you can use the opcodes 0x01 to 0x4b to indicate the number of bytes being pushed. Thus, to push a single byte of value 210 (0xD2) onto the stack, you would use the byte sequence 0x01 0xd2.



                  To push a 16-bit number, such as 1000 onto the stack, you would use the sequence of bytes 0x02 0xe8 0x03. Note that little-endian byte ordering is used. You can do similarly for a 24-bit number, or 32-bit number.



                  The minimum size should always be used when pushing a value - meaning the most significant byte of the pushed value should never be zero.



                  The value pushed will internally be zero-extended to a represent a 32-bit signed integer. All of the numeric operations in bitcoin script are limited to 32-bit integers. The result returned by a numeric operation can be treated as a signed 64-bit value, but values which overflow the 32-bit integer range may not be used in subsequent numeric operation.




                  On OP_PUSHDATA1, this is used for pushing arbitrary binary data onto the stack which may be used as arguments for operations such as OP_SHA256. This works by having the first byte of the sequence being OP_PUSHDATA1, the second byte being the length of the pushed data, and the remaining bytes being the content. For data more than 255 bytes, OP_PUSHDATA2 is used, where the second and third bytes of the sequence represent the length, and so on. The minimum size rule applies to all of the kinds of pushes, including that you should not try to push a single byte <=16 onto the stack using 2 bytes, but should instead use the OP_N single-byte opcodes.






                  share|improve this answer













                  You only need to use OP_PUSHDATA1 if you are trying to push more than 75 bytes of data onto the stack.



                  For pushing smaller sized values onto the stack, you can use the opcodes 0x01 to 0x4b to indicate the number of bytes being pushed. Thus, to push a single byte of value 210 (0xD2) onto the stack, you would use the byte sequence 0x01 0xd2.



                  To push a 16-bit number, such as 1000 onto the stack, you would use the sequence of bytes 0x02 0xe8 0x03. Note that little-endian byte ordering is used. You can do similarly for a 24-bit number, or 32-bit number.



                  The minimum size should always be used when pushing a value - meaning the most significant byte of the pushed value should never be zero.



                  The value pushed will internally be zero-extended to a represent a 32-bit signed integer. All of the numeric operations in bitcoin script are limited to 32-bit integers. The result returned by a numeric operation can be treated as a signed 64-bit value, but values which overflow the 32-bit integer range may not be used in subsequent numeric operation.




                  On OP_PUSHDATA1, this is used for pushing arbitrary binary data onto the stack which may be used as arguments for operations such as OP_SHA256. This works by having the first byte of the sequence being OP_PUSHDATA1, the second byte being the length of the pushed data, and the remaining bytes being the content. For data more than 255 bytes, OP_PUSHDATA2 is used, where the second and third bytes of the sequence represent the length, and so on. The minimum size rule applies to all of the kinds of pushes, including that you should not try to push a single byte <=16 onto the stack using 2 bytes, but should instead use the OP_N single-byte opcodes.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 7 hours ago









                  Mark HMark H

                  94919




                  94919





















                      1














                      To push data to the stack, if there is no opcode (i.e. there is no opcode for the number 210, but there are for the numbers 1-16: OP_1 - OP_16), you need to provide a push op. Since 210 can be represented in a single byte:



                      OP_10 0x01 210 OP_ADD
                      ^ ^ ^ ^
                      | | | | pop the top 2 items, add, and return result
                      | | | Push number 210 to the stack
                      | | The next 1 byte is pushed to the stack
                      | Push 10 to the stack


                      See https://en.bitcoin.it/wiki/Script#Constants






                      share|improve this answer





























                        1














                        To push data to the stack, if there is no opcode (i.e. there is no opcode for the number 210, but there are for the numbers 1-16: OP_1 - OP_16), you need to provide a push op. Since 210 can be represented in a single byte:



                        OP_10 0x01 210 OP_ADD
                        ^ ^ ^ ^
                        | | | | pop the top 2 items, add, and return result
                        | | | Push number 210 to the stack
                        | | The next 1 byte is pushed to the stack
                        | Push 10 to the stack


                        See https://en.bitcoin.it/wiki/Script#Constants






                        share|improve this answer



























                          1












                          1








                          1







                          To push data to the stack, if there is no opcode (i.e. there is no opcode for the number 210, but there are for the numbers 1-16: OP_1 - OP_16), you need to provide a push op. Since 210 can be represented in a single byte:



                          OP_10 0x01 210 OP_ADD
                          ^ ^ ^ ^
                          | | | | pop the top 2 items, add, and return result
                          | | | Push number 210 to the stack
                          | | The next 1 byte is pushed to the stack
                          | Push 10 to the stack


                          See https://en.bitcoin.it/wiki/Script#Constants






                          share|improve this answer















                          To push data to the stack, if there is no opcode (i.e. there is no opcode for the number 210, but there are for the numbers 1-16: OP_1 - OP_16), you need to provide a push op. Since 210 can be represented in a single byte:



                          OP_10 0x01 210 OP_ADD
                          ^ ^ ^ ^
                          | | | | pop the top 2 items, add, and return result
                          | | | Push number 210 to the stack
                          | | The next 1 byte is pushed to the stack
                          | Push 10 to the stack


                          See https://en.bitcoin.it/wiki/Script#Constants







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 31 mins ago

























                          answered 7 hours ago









                          JBaczukJBaczuk

                          4,8741322




                          4,8741322



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Bitcoin Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fbitcoin.stackexchange.com%2fquestions%2f85989%2fscript-bitcoin-represent-number-16%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              How to make RAID controller rescan devices The 2019 Stack Overflow Developer Survey Results Are InLSI MegaRAID SAS 9261-8i: Disk isn't recognized after replacementHow to monitor the hard disk status behind Dell PERC H710 Raid Controller with CentOS 6?LSI MegaRAID - Recreate missing RAID 1 arrayext. 2-bay USB-Drive with RAID: btrfs RAID vs built-in RAIDInvalid SAS topologyDoes enabling JBOD mode on LSI based controllers affect existing logical disks/arrays?Why is there a shift between the WWN reported from the controller and the Linux system?Optimal RAID 6+0 Setup for 40+ 4TB DisksAccidental SAS cable removal

                              Куамањотепек (Чилапа де Алварез) Садржај Становништво Види још Референце Спољашње везе Мени за навигацију17°19′47″N 99°1′51″W / 17.32972° СГШ; 99.03083° ЗГД / 17.32972; -99.0308317°19′47″N 99°1′51″W / 17.32972° СГШ; 99.03083° ЗГД / 17.32972; -99.030838877656„Instituto Nacional de Estadística y Geografía”„The GeoNames geographical database”Мексичка насељапроширитиуу

                              Срби Садржај Географија Етимологија Генетика Историја Језик Религија Популација Познати Срби Види још Напомене Референце Извори Литература Спољашње везе Мени за навигацијууrs.one.un.orgАрхивираноАрхивирано из оригиналаПопис становништва из 2011. годинеCOMMUNITY PROFILE: SERB COMMUNITY„1996 population census in Bosnia and Herzegovina”„CIA - The World Factbook - Bosnia and Herzegovina”American FactFinder - Results„2011 National Household Survey: Data tables”„Srbi u Nemačkoj | Srbi u Njemačkoj | Zentralrat der Serben in Deutschland”оригинала„Vesti online - Srpski informativni portal”„The Serbian Diaspora and Youth: Cross-Border Ties and Opportunities for Development”оригиналаSerben-Demo eskaliert in Wien„The People of Australia – Statistics from the 2011 Census”„Erstmals über eine Million EU- und EFTA Angehörige in der Schweiz”STANOVNIŠTVO PREMA NARODNOSTI – DETALJNA KLASIFIKACIJA – POPIS 2011.(Завод за статистику Црне Горе)title=Présentation de la République de SerbieSerbian | EthnologuePopulation by ethnic affiliation, Slovenia, Census 1953, 1961, 1971, 1981, 1991 and 2002Попис на населението, домаќинствата и становите во Република Македонија, 2002: Дефинитивни податоциALBANIJA ETNIČKI ČISTI SRBE: Iščezlo 100.000 ljudi pokrštavanjem, kao što su to radile ustaše u NDH! | Telegraf – Najnovije vestiИз удаљене Аргентине„Tab11. Populaţia stabilă după etnie şi limba maternă, pe categorii de localităţi”Суседи броје Србе„Srpska Dijaspora”оригиналаMinifacts about Norway 2012„Statistiques - 01.06.2008”ПРЕДСЕДНИК СРБИЈЕ СА СРБИМА У БРАТИСЛАВИСлавка Драшковић: Многа питања Срба у Црној Гори нерешенаThe Spread of the SlavesGoogle Book„Distribution of European Y-chromosome DNA (Y-DNA) haplogroups by country in percentage”American Journal of Physical Anthropology 142:380–390 (2010)„Архивирана копија”оригинала„Haplogroup I2 (Y-DNA)”„Архивирана копија”оригиналаVTS 01 1 - YouTubeПрви сукоби Срба и Турака - Политикин забавникАрхивираноConstantine Porphyrogenitus: De Administrando ImperioВизантиски извори за историју народа ЈугославијеDe conversione Croatorum et Serborum: A Lost SourceDe conversione Croatorum et Serborum: Изгубљени извор Константина ПорфирогенитаИсторија српске државностиИсторија српског народаСрбофобија и њени извориСерска област после Душанове смртиИсторија ВизантијеИсторија средњовековне босанске државеСрби међу европским народимаСрби у средњем векуМедијиПодациууууу00577267