Questions tagged [script]

A simple, stack-based, Forth-like programming language using "opcodes" to express spending conditions.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

Transaction help

When I run my raw script I get Error validating transaction: Error running script for input 0 referencing e67a0550848b7932d7796aeea16ab0e48a5cfe81c4e8cca2c5b03e0416850114 at 0: Script was NOT ...
Vijay Kadem's user avatar
1 vote
0 answers
30 views

NBitcoin doesn't produce same TapRoot address?

I have a script that works perfectly in creating an inscription taproot address with Javascript https://gist.github.com/ChristianOConnor/fa07462990a74606f486f97031783e50. I committed the private key ...
ChristianOConnor's user avatar
2 votes
0 answers
22 views

Lightning force close detection

┌────────────────────────────────────┐ ┌────────────────────────────┐ │ outputs contain revocation script? ├──yes──► force close w/ penalty = 3 │ └──────────────┬─────────────────────┘ ...
sanket1729's user avatar
  • 1,380
0 votes
0 answers
21 views

Does the Lightning Network support Bitcoin scripts, and what do the identifiers of Lightning wallets look like?

I'm currently exploring the deployment of Bitcoin scripts within the Lightning Network. Specifically, I'm interested in understanding the compatibility and functionality of Bitcoin scripts within the ...
Nerses Asaturyan's user avatar
1 vote
1 answer
30 views

spending P2TR script path output using python bitcoinutils library

I am currently trying to spend a P2TR output using one of the scripts used to create the address. Below is the python code I tried to construct raw transaction in order to spend the UTXO. The address ...
paranoid's user avatar
0 votes
1 answer
31 views

How to build a transaction that is valid for ANY input of an address but with a specific output

I am trying to achieve a more complex task, as an use-case where a company holds a very popular bitcoin address that has many hundreds of inputs (UTXOs) in related to stocks it issued. Now, the ...
skydanc3r's user avatar
  • 179
3 votes
1 answer
84 views

How are Bitkey's spending limits enforced?

Block's new Bitkey is a 2-of-3 multi signature wallet (https://bitkey.world/en-US) I've been reading their white paper, which is a good summary of their intentions, but doesn't really go into ...
atonaltensor's user avatar
1 vote
1 answer
41 views

Deriving bip84 addresses with python

Does anyone have a python script deriving the bip84 addresses from the private key? I do have the private root key so I don't need to go all the way from the private key. I'd like to do this with the ...
Peder Rustad's user avatar
1 vote
1 answer
73 views

How to identify P2TR output type?

The scriptpubkey alone can be used to identify the type of address. However, I'm debugging a library that's having difficulty differentiating the following transaction/scriptpubkey from a p2tr ...
arshbot's user avatar
  • 1,778
1 vote
1 answer
73 views

Is there any way for a script to depend on blockchain info?

The locktime opcodes OP_CHECKLOCKTIMEVERIFYand OP_CHECKSEQUENCEVERIFY indirectly allow for an approximate block number check, is there any way to obtain other information such as the previously mined ...
Tobias Kienzler's user avatar
2 votes
1 answer
140 views

If no push opcode, how does item still end up on stack (tx verification)

I was reading the following link and there it says: "Alice’s pubkey script then pushes the pubkey hash that Bob gave her for the first transaction". I mean how ? there's no opcode for that. ...
Giorgi Lagidze's user avatar
-1 votes
1 answer
83 views

Callback from computation threads to root UTXO without trusted third party signature

No expert on Bitcoin. How I understand it, loops can be done by UTXO storing a hash of the code it requires to run the next iteration in, and then the next iteration creates a new UTXO and runs it ...
Johan's user avatar
  • 1
2 votes
1 answer
105 views

Can OP_DROP be used to include arbitrary data?

I have recently been looking into OP_RETURN and its uses in so far as including data in a transaction. Given the fact that OP_RETURN is limited to 80 bytes I thought what if OP_DROP was used? That way ...
user2334659's user avatar
1 vote
3 answers
229 views

Where can I see Taproot scripts?

I am trying to look more into Taproot scripts and was wondering if someone could help me on how to access them? I was thinking of using a blockchain explorer that decodes Taproot scripts but I can't ...
mark's user avatar
  • 25
1 vote
0 answers
28 views

Ways of emulating OP_CAT

I understand that it's possible to emulate concatenation for up to 32 bits by calculating: x || y = x + (y << len(x)), where the left shift (L_SHIFT) can be performed through multiple ...
msinkec's user avatar
  • 43
1 vote
1 answer
127 views

Are there plans to make a script invalid if there is more than one element left in the stack?

In BIP62, it was proposed to make a script invalid if there was more than one element left in the stack after execution. This proposal was eventually withdrawn. From what I read, some people have ...
mathboi's user avatar
  • 193
2 votes
1 answer
131 views

What’s going on with this "NULL address input" transaction?

I was reading this from the Bitcoin wiki (https://en.bitcoin.it/wiki/From_address). I understand the concept of UTXOs and that any input to a transaction is an output from a previous transaction. I ...
user2334659's user avatar
3 votes
1 answer
74 views

Do any browser wallets support custom bitcoin scripts?

I am creating an atomic swap interface between Bitcoin and EVM using hashed timelock contracts as the underlying swapping mechanism. The idea is to support atomic swaps via the browser, using browser-...
Oscar Chambers's user avatar
2 votes
1 answer
87 views

What is the point of having a script language now?

When I first started learning how transaction are validated, it made sense why a script language was needed: the scriptPubKey was executed along the scriptSig, the software just executes this "...
mathboi's user avatar
  • 193
2 votes
1 answer
272 views

What was the OP_IF opcode used for (except Lightning) before 2023?

There is the OP_IF opcode in Script. What did users use the OP_IF opcode for (use cases except for Lightning) before 2023? What tools to use to extract the transactions (with OP_IF) from historical ...
Greg Tonoski's user avatar
4 votes
1 answer
144 views

Is there a way to push the output value of a UTXO to the stack in Bitcoin script?

When defining the spending conditions for a UTXO can one use the output value in a script by pushing it to the stack?
Poseidon's user avatar
  • 693
2 votes
1 answer
75 views

Is the Taproot script tree commitment quantum safe?

If an attacker in posession of a quantum computer can break the ECDLP, they can of course spend every Taproot output using the key path. However, do they also have the ability to construct a valid ...
Vojtěch Strnad's user avatar
0 votes
1 answer
50 views

How to set the output script of coinbase transaction

I found that the "getaddressinfo" command in RPC can get pubkey and scriptpubkey. My address pubkey scriptpubkey are: address='bcrt1q95h0le6kknpnjp4c29cau03gvdyxd35zug30yr' pubKey='...
Jack Green's user avatar
1 vote
1 answer
55 views

Is it possible to use Bitcoin Script to implement a quantum-resistant locking script that would be safe to spend from?

Stewart, I., et. al. (2018). "Committing to quantum resistance: A slow defence for Bitcoin against a fast quantum computing attack" described a method by which funds could be safely moved ...
bca-0353f40e's user avatar
  • 1,025
0 votes
1 answer
108 views

What is an "empty vector" in Bitcoin?

EDIT: Pieter Wuille gave an answer (look at the comments) to the last situation (with OP_CHECKSIG). OP_CHECKSIG is pushing 0x00. E.g. OP_0 pushes the empty vector, which represents the number 0 (to ...
Cosmos's user avatar
  • 199
1 vote
1 answer
119 views

Is the signature check performed when the signature is the empty vector?

In this answer Vojtěch Strnad wrote the following: OP_CHECKSIGADD always performs one check per signature, since unused public keys are required to be paired with an empty witness item and are ...
Cosmos's user avatar
  • 199
1 vote
1 answer
99 views

What are the all benefits/advantages of OP_CHECKSIGADD over OP_CHECKMULTISIG?

What are all the benefits of introducing OP_CHECKSIGADD in Taproot instead of OP_CHECKMULTISIG? I assume the first benefit is the following. For example, in pre-taproot approach, if we have 3-of-10 ...
Cosmos's user avatar
  • 199
2 votes
1 answer
112 views

What would happen if we provide to OP_CHECKMULTISIG more than threshold number (m) of signatures?

Asked here but still no answer. What would happen if we provide to OP_CHECKMULTISIG opcode more than threshold number (m) of signatures? For example, if the m = 3 and n = 6 and the output script is: 3 ...
Cosmos's user avatar
  • 199
2 votes
1 answer
119 views

non-mandatory-script-verify-flag (Invalid Schnorr signature) when trying to reveal a TR output

I'm building a Bitcoin wallet, and I'm trying to spend a Taproot output via a script spend path, but I keep running into this "Invalid Schnorr signature" error from my RPC node: { "...
Sherwin Li's user avatar
-2 votes
1 answer
50 views

Question on the integer size [closed]

Is there any kind of boolean division with bitcoin? There has to be something before the decimal number. Kind of say it seems like end to end and it always should be the number that is largest.
Brent's user avatar
  • 1
4 votes
1 answer
242 views

How is this transaction valid?

Transaction in question: 16ac7736552c5791cff5643e6104c76c24018236b2193e014b308efea4f32f81 The P2SH input has a strange redeem script: OP_DUP OP_HASH160 OP_PUSHBYTES_20 ...
Vojtěch Strnad's user avatar
1 vote
1 answer
199 views

Verifying a zkSNARK on Bitcoin/Hope for a future with OP_MUL

I am trying to write a script that can verify a SNARK, but from what I understand OP_MUL is still disabled in TapScript. Is anyone working on a BIP to provide OP_MUL or OP_MUL64? It seems ...
Carter Feldman's user avatar
0 votes
1 answer
134 views

processing input tx in bitcoin's block response and obtain transaction value of each input

so i was parsing the block #496 of bitcoin which contains two transactions, first tx in the list is the reward tx and the second tx contains three inputs and one output. i tried to parse each ...
Monte Conte's user avatar
5 votes
1 answer
216 views

Why does Miniscript add an extra size check for hash preimage comparisons?

When I input the following miniscript into https://bitcoin.sipa.be/miniscript/: and(pk(claimant_pk),sha256(H)) I get the following Script: <claimant_pk> OP_CHECKSIGVERIFY OP_SIZE <20> ...
Sachin Meier's user avatar
3 votes
2 answers
590 views

Undefined opcodes in bitcoin core defined as "Synonyms for OP_RETURN" in rust-bitcoin

In rust-bitcoin, opcodes past the 0xba opcode are named as such: OP_RETURN_187, OP_RETURN_188, ..., OP_RETURN_254. Their description is all the same: Synonym for OP_RETURN. The definition for ...
thunderbiscuit's user avatar
2 votes
1 answer
151 views

Is OP_CODESEPARATOR disabled in Bitcoin and if so why?

OP_CODESEPARATOR is used in the Bitcoin script language to mark the beginning of signature-checked data. However, the given operator never found its real practical use case. So, is the given operator ...
dassd's user avatar
  • 1,069
8 votes
1 answer
317 views

Why are OP_MUL and OP_DIV disabled in Bitcoin?

What is the reason why OP_MUL and OP_DIV operators were removed from Bitcoin? Is this because someone could maliciously create a script that multiplies large numbers and thus blows the stack, or is ...
dassd's user avatar
  • 1,069
0 votes
1 answer
53 views

P2SH-P2WSH-P2PKH and P2SH-P2WPKH

What are the advantages and disadvantages of using P2WSH-wrapped P2PKH instead of P2WPKH? What are the advantages and disadvantages of using P2SH-wrapped P2WSH-wrapped P2PKH instead of P2SH-wrapped ...
Mercedes's user avatar
  • 802
0 votes
0 answers
57 views

conditional spending from P2WSH address

What im doing wrong? Sinse I found out that Bitcoin is programmable money Im trying to use it potential. Using this site https://improvein.github.io/bitcoin-forge/?#/script/create I’ve created a ...
bitc's user avatar
  • 1
1 vote
0 answers
24 views

Scripting an escrow transaction where the arbitrator ALWAYS gets paid

I am trying to make an Escrow and Arbitration where the arbitrator always gets paid say 5% of the transaction. As in the famous escrow example here: Charlie-the-customer wants to buy a product from ...
Farahats9's user avatar
  • 111
2 votes
1 answer
67 views

Is it possible to create an output locked to a specific mining difficulty target?

When the network sees a block appear with enough difficulty nodes can detect this as potentially the longest valid chain allowing the blocks miner to officially claim the block reward via coinbase ...
Poseidon's user avatar
  • 693
4 votes
1 answer
163 views

Why is concatenating scriptPubKeys and scriptSigs unsafe?

Around the 5:00 timestamp in this talk, John Newbery states that running the concatenation of scriptPubKey and scriptSig is unsafe, since it can result in someone using a carefully crafted scriptSig ...
Cosmik Debris's user avatar
2 votes
1 answer
125 views

Bitcoin Script Puzzle

I found this script puzzle post by ValentinoZ: https://twitter.com/vazertuche/status/1691814230129848473 I've tried solving it and can't seem to get it. I get stuck at the op_equalverify for the hash ...
Marco's user avatar
  • 395
1 vote
2 answers
38 views

Why is this P2WSH spend triggering a verification failure when broadcasting?

I'm experiment with building SegWit transactions manually, and I've written a non-standard simple script just for testing. No signing or anything, just your usual "add two numbers, check equality&...
ursuscamp's user avatar
2 votes
2 answers
244 views

Can the same set of private keys be used multiple times in a multisig wallet?

Is there any limitation to how many times the same set of private keys can exist within a multisig wallet? For example, could a 3 of 4 multisig wallet be created with two of the four keys being ...
Guru Josh's user avatar
  • 171
1 vote
2 answers
131 views

When the validity of scriptPubKey is checked?

I have a couple of questions related to validation of script in transaction output (scriptPubKey). I apologize for a little more text, but I tried to explain in detail what I don't understand. Since ...
dassd's user avatar
  • 1,069
0 votes
1 answer
49 views

Is there any workaround exist to restrict spending output address from Bitcoin Script?

Hey folks, I know this question is pretty much similar to the one, that was asked 5 years ago. I'd like to share my research and ask, if there are any movements in this fields since then? Or maybe ...
as_ter's user avatar
  • 1
0 votes
2 answers
57 views

How can one make a transaction that any address can claim it just by solving the scriptPubKey?

I just learned that Mike Hearn created a Bitcoin Puzzle transaction where the first person to solve its scriptPubKey, could claim that transaction's amount as a reward. The thing is... Aren't all the ...
Pedro D.'s user avatar
0 votes
1 answer
81 views

How to get the hex for a tx input (for btcdeb tool)

I am trying to understand how btcdeb (Bitcoin script debugger from Bitcoin core) works. In the usecase of btcdeb --tx=<tx hex> --txin=<txin hex>, how does one obtain the hex of the input ...
Alec Matusis's user avatar
2 votes
1 answer
251 views

Is the Taproot upgrade really essential for BRC-20 tokens on Bitcoin?

BRC-20 currently relies on the Taproot upgrade. I'm wondering how blockchains such as Dogecoin, which have Bitcoin as their predecessor and did not upgrade to Taproot, manage to support BRC-20. More ...
leotron's user avatar
  • 23

1
2 3 4 5
13