Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [script]

This tag should be used for questions regarding Bitcoin transaction scripts or scripting languages used in transactions of altcoins such as Solidity. Scripts are a set of instructions on how to complete a transaction.

0
votes
1answer
26 views

How to generate an output address from output scrips which start with 0x00?

A few days ago, I got a BITCOIN traffic which contains some tx message. some of tx messages contain witness data. I want to produce all output addresses from transaction output scripts. I extracted ...
1
vote
1answer
33 views

Bitcoin Blocks Date not coherent? [duplicate]

I was taking data from the BTC Blockchain with a custom script. I found something really weird. Block nr. 24668 was created at 2009-10-09 23:02:57 Block nr. 24669 was created at 2009-10-10 00:15:48 ...
2
votes
1answer
99 views

How i can extract all bitcoin output addresses from tx message?

I want to extract output addresses from tx messages in any bitcoin pcap. currently, i extract tx messages which it's output script starts with "0x76" or "0xA9", but i don't know how can i extract the ...
1
vote
2answers
49 views

How to extract raw script from tx messages when the output script starts with 0xA9?

I'm working on extracting output addresses from tx messages in BITCOIN packets. Currently, I extract address from output scripts which starts with 0x76(OP_DUP) like this : 76 a9 14 6d 1d 74 58 95 6e ...
1
vote
1answer
30 views

Multisig without P2WSH in Lightning

The current Lightning implementations use P2WSH script format for multisig in the funding transaction. But it is also possible to use the CHECKMULTISIG opcode "natively", i.e., without P2WSH (see ...
0
votes
1answer
35 views

Are Relay Addresses Possible?

Is it possible to create an address such that different parties can spend certain portions of any output spent to that address? R: 1zaybxcrandrelayexampaddr A: 1xyzabcrandexampladdressa 97% B: ...
2
votes
0answers
42 views

How to make a homomorphic preimage/payment hash with current lightning network / Bitcoin implementations?

If I remember / understand it correctly by using the mechanisms from the scriptless scripts paper we could easily create homomorphic preimages / paymenthashes. I think this would be a very desirable ...
1
vote
1answer
93 views

Besides transaction validation, are there any other uses of the Script language in Bitcoin

Script's stack operations are used to validate signatures and scripts of transaction inputs and outputs. Is Script also used to validate block, network, or any other data? Seem like there are a lot ...
3
votes
1answer
42 views

Differences to CCompactSize and CVarInt

I'm developing a parser bitcoin core and I have a problem whit the type CVarInt, I using the decodifier mode of the CCompact size but at the block 976 I Have a problem whit the type, because the value ...
1
vote
1answer
39 views

Script Null into raw trasaction bitcoin core

I'm developing a parser for bitcoin core and into the alpha test of the parser,I noticed than the script bitcoin core are null and the hash raw transaction exist. An example: for this transaction the ...
0
votes
1answer
34 views

Script to import multiple priv keys in Electrum

DuckDuckGo turns up nothing of interest. How to import multiple priv keys in Electrum from a file using Electrum console or shell script, for all derivable valid BTC addresses? (1,3,bc1) Eventually I ...
1
vote
0answers
30 views

Error mandatory-script-verify-flag-failed (Signature is found in scriptCode)

I found a few questions with the specific error, but couldn't find also the appropriate answer. So, here I am. I am working on regtest in a Python library that create transactions and then use JSON-...
2
votes
2answers
58 views

Script Bitcoin represent number > 16

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 ...
1
vote
1answer
34 views

How to convert P2PKH to Hash160 (or something else acceptable by Script)?

How to convert a bitcoin address (starts with 1) to the right format acceptable by script (I'm using this Ruby library)? I'm doing this: tx.output do |o| o.value(50000) o.script { |s| s.recipient(...
2
votes
1answer
157 views

Bitcoin scripts that force disclosure of the private key

Context: I am creating an example code that would demonstrate an atomic swap between Elements and Bitcoin, with the aim that the swap transactions cannot be trivially linked, as it would be with ...
2
votes
0answers
18 views

Script and DER in P2PKH

Im trying to figure out the script and DER In P2PKH, the "first part (scriptsig)" push in stack (<sig><pubK>) because is it DER? Instead the "second part (scriptPubKey)" you can map the ...
1
vote
1answer
103 views

Why are only specific transaction types accepted into the mempool?

In the Bitcoin Mainnet, only specific transaction types are accepted: Bitcoin uses a scripting language to specify (and satisfy) the encumbrances, thereby allowing a whole host of transaction types....
0
votes
1answer
27 views

What did Deepbit to make their inputs special on transactions?

It seems Deepbit uses a strange format for it’s transactions on the addresses it owned. For example, in this transaction all inputs but 3 comes from Deepbit. Even Bitcoin core can’t decode addresses ...
0
votes
0answers
32 views

Coinbase “convert” API?

I use the convert functions at coinbase to take advantage of market changes to increase my position amounts. This weekend I am going to write a php script that tracks the available conversion pairs ...
0
votes
1answer
38 views

Which parts of a bitcoin script are embedded in the blockchain?

I assume the scriptPubKey is contained in a UTXO, and therefore embedded in the blockchain. Since, this is the script used to unlock the input. Is a scriptSig also embedded in the blockchain? Or is ...
0
votes
2answers
63 views

Verifying a digital signature that a transaction is going to an output with value X inside a script

Edit; after writing this post i have found that OP_CHECKDATASIG is basically this in a nutshell. It is implemented on Bitcoin Cash and may soon be on Bitcoin Core as well. Someone has even written ...
1
vote
1answer
77 views

In the bitcoin scripting language, how can I access other outputs of the transaction? Or how else can I limit how the coins may be spent?

Is there any way to add an opcode to a UTXO that prevents how the coins are spent? For example, in order to to spend the output, a person must send X number of bitcoin to Y address within the ...
0
votes
0answers
42 views

How to assemble and test a script on Bitcoin testnet online?

Given a script using Multisig, how can I convert addresses to hash that can be used in the script then assemble the script and then launch it inside a transaction on Bitcoin testnet that can viewed on ...
1
vote
2answers
64 views

How to search for a transaction using a specifc OPCODE?

I have several OPCODES where I need real worlds examples… However they are rarely used. So how to search and disassemble an existing mined transaction using it ?
0
votes
1answer
58 views

What’s the opcode sequence for doing the reverse of Multisig?

With a multisig wallet, several public keys are needed to spend an amount. But how to perform the reverse with time ? I’m talking about this case where Alice performs a transaction where the output ...
2
votes
1answer
44 views

How to disassemble a bitcoin script?

There are many explorers which allows to dissamble a transaction back into opcodes. But what about scripts which aren’t broadcasted yet like this redeem script :...
0
votes
1answer
21 views

Destination address(es) when redeeming an HTLC

Starting from this text at https://en.bitcoin.it/wiki/Script: "The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two ...
2
votes
1answer
55 views

Why CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY opcodes have to be succeeded with DROP Opcode?

Opcodes that end in VERIFY generally do not leave anything on the stack. What's so different and the reasoning when designing these opcodes that CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY opcodes ...
0
votes
1answer
71 views

ScriptCode field in P2SH-P2WPKH BIP-143 Test Vector

I'm trying to understand the meaning of scriptCode in the context of spending a P2SH(P2WPKH) UTXO. I've already read the following answer to a similar question, but it does not fully address my ...
0
votes
4answers
222 views

OP_CHECKDATASIGVERIFY not working

I'm trying to generate a signature and pass it through OP_CHECKDATASIGVERIFY as part of a P2SH address on a regtest network. This results in the following: Public Key: ...
0
votes
2answers
54 views

Can someone help me understand what these scripts mean?

Could someone explain what the commands i have in bold do? if possible. Thank you. Transaction URL www.blockchain.com/btc/tx Input Scripts- ScriptSig: PUSHDATA(71)[...
0
votes
1answer
32 views

How to split the funds and send X% to fee wallet and the remaining funds to another wallet?

Anybody have any idea about how to do it? User send the bitcoins X% goes to fee wallet remaining funds goes to service wallet I'm trying to use the "sendfrom" but it's not working because he only ...
0
votes
0answers
23 views

OP_CHECKSIG NULLFAIL with btcdeb

I'm using btcdeb to understand script. I pick a old random P2PKH transaction form mainnet, and paste unlocking script e locking script inside. I know that this script is ok, because I can check on ...
0
votes
0answers
27 views

Uniquely identifying a UTXO

I see two ways: Txid + index Txid + script hash Pros of the txid + index: Simple and short Cons of txid + index: It relies on array iteration being deterministic and all third party ...
1
vote
1answer
39 views

what is the use of OP_PUSHBYTES

what is the meaning of this SCRIPTPUBKEY: OP_DUP OP_HASH160 OP_PUSHBYTES_20 xxxxx....xxxxxxxx OP_EQUALVERIFY OP_CHECKSIG in particular I searched for some documentation on OP_PUSHBYTES_X which only ...
0
votes
0answers
32 views

Check an outpoint's scriptPubKey against known scripts

So I would like to check if coin.out.scriptPubKey is part of GetScriptForDestination(mypubkey.GetID()) A simple comparison isn't possible as the scriptPubKey (when I decode it) contains only the ...
1
vote
1answer
93 views

Bitcoin Script: mandatory-script-verify-flag-failed Script failed an OP_EQUALVERIFY operation

I try to spend a P2SH transaction (in regtest) with a timelockscript of 200 blocks. I got the following error: mandatory-script-verify-flag-failed (Script failed an OP_EQUALVERIFY operation) (...
0
votes
1answer
38 views

Original bitcoin core has one script.cpp.where is interepreter for it?I want to write hello world compiler to understand this.?

How to understand script.cpp and its interpreter.I understand register and postfix operation. I want to understand how script is parsed into machine code.Can i write hello world such as only pushing ...
5
votes
0answers
121 views

Did the introduction of VerifyScript cause a backwards incompatible change to consensus?

My question is about the changes to bitcoin done by commit range [a75560d8, 6ff5f718], and their effect on consensus. Out of this range of four commits (all attributed to satoshi) during the dates ...
1
vote
1answer
57 views

Maximum standard input script size

What is the maximum size for an input script so to be considered standard ? Looking at the Bitcoin Core source code it appears to be 10'000 byte, however reading here and there, it appears to be 1650 ...
4
votes
1answer
41 views

Is the bit encoding format for the graphic in BIP 68 implicitly little-endian?

CLTV (OP_CHECKLOCKTIMEVERIFY - absolute locktime) and CSV (OP_CHECKSEQUENCEVERIFY - relative locktime) utilize BIP 68. Is the locktime for those two operations implicitly encoded in little-endian ...
1
vote
1answer
55 views

What is the meaning of in-script and out-script in standard bitcoin transaction?

I am new to bitcoin world and I am reading this paper: Secure multiparty computations on Bitcoin https://eprint.iacr.org/2013/784.pdf The author said on page 7 that the standard bitcoin transaction ...
1
vote
2answers
38 views

Valid public key check in transaction output

Let's say I build a P2MS output script using uncompressed public keys, and let's say too that these public keys are not valid, i.e. they do not represent a valid EC Point and they don't start with ...
0
votes
1answer
64 views

Create simple and secure transaction without checksig?

According to my previously asked question (P2SH secure spending. How?) creating transactions without signature checking is probably not secure. Anyway, I see many transactions (for ex.:...
1
vote
1answer
26 views

Script - Is it possible to build an addresss that allows retrieve a certain amount per address?

Is it possible to define a multi signature address that allows spending only certain percentage to each signature? For example, three different people with different public-private keys build an pay ...
2
votes
2answers
150 views

Operation not valid with the current stack size

According to bip65 https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki I can use expressions like IF ... ELSE ... ENDIF Here is example script from this document: IF HASH160 <...
1
vote
1answer
114 views

Why this transaction is invalid?

I issued this transaction on testnet (for a homework later solved with another script). python-bitcoinlib validates the transaction but when i submit it to blockcypher it gets rejected with error: {"...
0
votes
2answers
36 views

In theory could a pubkeyhash script be solved without the public key in the scriptSig?

When signing a pubkeyhash UTXO, it is required to provide both a signature and a public key. The public key is duplicated and one copy is provided to op_checksigverify to ensure the signature is valid,...
0
votes
2answers
109 views

Non-standard transaction scripts broadcasting

I'm developing an application on Bitcoin blockchain, and I use output transaction scripts that are not standard according to the classic payment methods. However, even so, on Tesnet everything works ...
2
votes
1answer
122 views

Why is 20 the maximum public keys in a multisig transaction?

In script.h the following limit is set: MAX_PUBKEYS_PER_MULTISIG = 20 I'm wondering: Why is the limit set to 20? How would one would construct a script that allows n more than the current OP_16? E....