• About
  • FAQ
  • Earn Bitcoin while Surfing the net
  • Buy & Sell Crypto on Paxful
Newsletter
Approx Foundation
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
  • Home
    • Home – Layout 1
  • Bitcoin
  • Ethereum
  • Regulation
  • Market
  • Blockchain
  • Business
  • Guide
  • Contact Us
No Result
View All Result
Approx Foundation
No Result
View All Result
Home Bitcoin

Spending one-OP-code-long scripts

Moussa by Moussa
May 20, 2025
in Bitcoin
0
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


One simple example is an OP_TRUE (0x51) script which decoded by bitcoin-cli on any testnet (incl. signet) network says following:

Related articles

Bitcoin ETFs Add $142M As September Trading Opens With Inflows

Bitcoin ETFs Add $142M As September Trading Opens With Inflows

September 2, 2026
Billionaire Ricardo Salinas Tells People To Escape Fiat

Billionaire Ricardo Salinas Tells People To Escape Fiat

September 2, 2026
$ bitcoin-cli -testnet4 decodescript 51
{
  "asm": "1",
  "desc": "raw(51)#8lvh9jxk",
  "type": "nonstandard",
  "p2sh": "2ND8PB9RrfCaAcjfjP1Y6nAgFd9zWHYX4DN",
  "segwit": {
    "asm": "0 4ae81572f06e1b88fd5ced7a1a000945432e83e1551e6f721ee9c00b8cc33260",
    "desc": "addr(tb1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqaqh7jw)#gtc05zpf",
    "hex": "00204ae81572f06e1b88fd5ced7a1a000945432e83e1551e6f721ee9c00b8cc33260",
    "address": "tb1qft5p2uhsdcdc3l2ua4ap5qqfg4pjaqlp250x7us7a8qqhrxrxfsqaqh7jw",
    "type": "witness_v0_scripthash",
    "p2sh-segwit": "2N3i4C56DiqfpdcAJsAdZd2xYpCQMRAroye"
  }
}

It can be spent by using 02 0151 as a script length and scriptsig. This is how it looks in a full raw hex transaction present on Testnet4:

VERSION: 02000000
INPUTS: 01
 2221fab941cdb15ed1cc9dbd7511f55fec5044821a5053034b066bcc38d91bf5 01000000 02 0151 fdffffff
OUTPUTS: 01
 ff02000000000000 04 51024e73
LOCKTIME: 15700000

The transaction can be easily reconstructed from this readable hex format into a long one-line hex string on a *NIX terminal just by using tr -d ' [A-Z]:\n-' | grep ., i.e. removing any spaces, upper-case letters, colons, newlines and hyphens.

Spending the same from P2WSH or P2SH-Segwit address is very similar, just instead of adding to scriptsig one would use the input’s witness instead.

I know how to spend from scripts that use just one op-code when it is from range 51 – 61 (hex), but I have no idea how to spend (or even if it is possible at all to do it) in this way from addresses belonging to 00, 4f, 63 (OP_IF) and many others with higher-number op-codes where addresses for them exist. Some like 62 are giving this output so it is very easy to not even try:

{
  "asm": "OP_VER",
  "desc": "raw(62)#ttuhp9rg",
  "type": "nonstandard"
}

Is it possible to spend from addresses belonging to the other (see above) scripts only-one op-code (or one octet) long*? How?

* For example from 2NDNfojz7c4GS1RKxqUHKm8mk5URLskt65L



Source link

Share76Tweet47

Related Posts

Bitcoin ETFs Add $142M As September Trading Opens With Inflows

Bitcoin ETFs Add $142M As September Trading Opens With Inflows

by Moussa
September 2, 2026
0

U.S. spot Bitcoin ETFs recorded $142 million in net inflows as September trading opened, giving Bitcoin traders a positive flow...

Billionaire Ricardo Salinas Tells People To Escape Fiat

Billionaire Ricardo Salinas Tells People To Escape Fiat

by Moussa
September 2, 2026
0

Mexican billionaire Ricardo Salinas is at it again.  This time, the third richest man in Mexico told his followers that...

Bitcoin Hashrate Enters First Bear Market as AI Pulls Miners Away

Bitcoin Hashrate Enters First Bear Market as AI Pulls Miners Away

by Moussa
September 2, 2026
0

Key TakeawaysTwenty One Capital says bitcoin entered its first hashrate bear market after peaking near 1.3 ZH/s.AI demand is pulling...

Would replace key work in this specific multisig case?

by Moussa
September 2, 2026
0

In the time-sensitive scenario where someone wants to make a transaction on their 2 of 3 Sparrow multisig wallet but...

MicroStrategy Resumes Bitcoin Accumulation After Extended Buying Gap

MicroStrategy Resumes Bitcoin Accumulation After Extended Buying Gap

by Moussa
September 2, 2026
0

The MicroStrategy Bitcoin buying has resumed after a roughly 10-week pause, adding 4,603 BTC for approximately $370M. The purchase lifts...

Load More

youssufi.com

sephina.com

[vc_row full_width="stretch_row" parallax="content-moving" vc_row_background="" background_repeat="no-repeat" background_position="center center" footer_scheme="dark" css=".vc_custom_1517813231908{padding-top: 60px !important;padding-bottom: 30px !important;background-color: #191818 !important;background-position: center;background-repeat: no-repeat !important;background-size: cover !important;}" footer_widget_title_color="#fcbf46" footer_button_bg="#fcb11e"][vc_column width="1/4"]

We bring you the latest in Crypto News

[/vc_column][vc_column width="1/4"][vc_wp_categories]
[/vc_column][vc_column width="1/4"][vc_wp_tagcloud taxonomy="post_tag"][/vc_column][vc_column width="1/4"]

Newsletter

[vc_raw_html]JTNDcCUzRSUzQ2RpdiUyMGNsYXNzJTNEJTIydG5wJTIwdG5wLXN1YnNjcmlwdGlvbiUyMiUzRSUwQSUzQ2Zvcm0lMjBtZXRob2QlM0QlMjJwb3N0JTIyJTIwYWN0aW9uJTNEJTIyaHR0cHMlM0ElMkYlMkZhcHByb3gub3JnJTJGJTNGbmElM0RzJTIyJTNFJTBBJTBBJTNDaW5wdXQlMjB0eXBlJTNEJTIyaGlkZGVuJTIyJTIwbmFtZSUzRCUyMm5sYW5nJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1maXJzdG5hbWUlMjIlM0UlM0NsYWJlbCUyMGZvciUzRCUyMnRucC0xJTIyJTNFRmlyc3QlMjBuYW1lJTIwb3IlMjBmdWxsJTIwbmFtZSUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnRucC1uYW1lJTIyJTIwdHlwZSUzRCUyMnRleHQlMjIlMjBuYW1lJTNEJTIybm4lMjIlMjBpZCUzRCUyMnRucC0xJTIyJTIwdmFsdWUlM0QlMjIlMjIlM0UlM0MlMkZkaXYlM0UlMEElM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1lbWFpbCUyMiUzRSUzQ2xhYmVsJTIwZm9yJTNEJTIydG5wLTIlMjIlM0VFbWFpbCUzQyUyRmxhYmVsJTNFJTBBJTNDaW5wdXQlMjBjbGFzcyUzRCUyMnRucC1lbWFpbCUyMiUyMHR5cGUlM0QlMjJlbWFpbCUyMiUyMG5hbWUlM0QlMjJuZSUyMiUyMGlkJTNEJTIydG5wLTIlMjIlMjB2YWx1ZSUzRCUyMiUyMiUyMHJlcXVpcmVkJTNFJTNDJTJGZGl2JTNFJTBBJTNDZGl2JTIwY2xhc3MlM0QlMjJ0bnAtZmllbGQlMjB0bnAtcHJpdmFjeS1maWVsZCUyMiUzRSUzQ2xhYmVsJTNFJTNDaW5wdXQlMjB0eXBlJTNEJTIyY2hlY2tib3glMjIlMjBuYW1lJTNEJTIybnklMjIlMjByZXF1aXJlZCUyMGNsYXNzJTNEJTIydG5wLXByaXZhY3klMjIlM0UlQzIlQTBCeSUyMGNvbnRpbnVpbmclMkMlMjB5b3UlMjBhY2NlcHQlMjB0aGUlMjBwcml2YWN5JTIwcG9saWN5JTNDJTJGbGFiZWwlM0UlM0MlMkZkaXYlM0UlM0NkaXYlMjBjbGFzcyUzRCUyMnRucC1maWVsZCUyMHRucC1maWVsZC1idXR0b24lMjIlM0UlM0NpbnB1dCUyMGNsYXNzJTNEJTIydG5wLXN1Ym1pdCUyMiUyMHR5cGUlM0QlMjJzdWJtaXQlMjIlMjB2YWx1ZSUzRCUyMlN1YnNjcmliZSUyMiUyMCUzRSUwQSUzQyUyRmRpdiUzRSUwQSUzQyUyRmZvcm0lM0UlMEElM0MlMkZkaXYlM0UlM0NiciUyRiUzRSUzQyUyRnAlM0U=[/vc_raw_html][/vc_column][/vc_row]
No Result
View All Result
  • Contact Us
  • Homepages
  • Business
  • Guide

© 2024 APPROX FOUNDATION - The Crypto Currency News