Bitcoin Forum
May 05, 2024, 03:58:00 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Can I/Miners spend an output with anyone-can-spend public script?  (Read 163 times)
polaker (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 3


View Profile
January 12, 2020, 08:03:33 PM
 #1

As I am reading BIP 141, there is a sentence saying "Wallets should always be wary of anyone-can-spend scripts and treat them with suspicion."

Does this mean that by default anyone-can-spend scripts are disabled and cannot be used?

Since segwit is a soft fork, what would happen if a miner treats some of the segwit outputs as anyone-can-spend scripts (as pre-seg scripts) and spend them in a new block?
1714881480
Hero Member
*
Offline Offline

Posts: 1714881480

View Profile Personal Message (Offline)

Ignore
1714881480
Reply with quote  #2

1714881480
Report to moderator
1714881480
Hero Member
*
Offline Offline

Posts: 1714881480

View Profile Personal Message (Offline)

Ignore
1714881480
Reply with quote  #2

1714881480
Report to moderator
1714881480
Hero Member
*
Offline Offline

Posts: 1714881480

View Profile Personal Message (Offline)

Ignore
1714881480
Reply with quote  #2

1714881480
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714881480
Hero Member
*
Offline Offline

Posts: 1714881480

View Profile Personal Message (Offline)

Ignore
1714881480
Reply with quote  #2

1714881480
Report to moderator
ABCbits
Legendary
*
Offline Offline

Activity: 2870
Merit: 7464


Crypto Swap Exchange


View Profile
January 12, 2020, 08:11:52 PM
Merited by darosior (1)
 #2

Does this mean that by default anyone-can-spend scripts are disabled and cannot be used?

AFAIK it's the opposite.

Since segwit is a soft fork, what would happen if a miner treats some of the segwit outputs as anyone-can-spend scripts (as pre-seg scripts) and spend them in a new block?

Most Bitcoin full nodes (whether it's run by miner, exchange or regular user) would reject such block because there's no valid redeem script or the UTXO is invalid.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
polaker (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 3


View Profile
January 12, 2020, 10:37:34 PM
 #3

Does this mean that by default anyone-can-spend scripts are disabled and cannot be used?

AFAIK it's the opposite.

Since segwit is a soft fork, what would happen if a miner treats some of the segwit outputs as anyone-can-spend scripts (as pre-seg scripts) and spend them in a new block?

Most Bitcoin full nodes (whether it's run by miner, exchange or regular user) would reject such block because there's no valid redeem script or the UTXO is invalid.

Then I don't quite get the point of "Wallets should be wary of any-one-can-spend scripts"
nc50lc
Legendary
*
Online Online

Activity: 2408
Merit: 5588


Self-proclaimed Genius


View Profile
January 13, 2020, 03:04:31 AM
Merited by ABCbits (1)
 #4

As I am reading BIP 141, there is a sentence saying "Wallets should always be wary of anyone-can-spend scripts and treat them with suspicion."
Based from what I understand, it's still on-topic about the paragraph's title "backward compatibility" and talking about "wallets of/connected to non-upgraded nodes".
It used "wallets", so not just Bitcoin Core but including other clients that might misread witness data because:

Quote from:  bip-0141
Non-upgraded nodes, however, will not see nor validate the witness data and will consider all witness programs as anyone-can-spend scripts
-snip-
What a non-upgraded wallet cannot do:
Validating segregated witness transaction. It assumes such a transaction is always valid
'think this quote is enough?

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
HeRetiK
Legendary
*
Offline Offline

Activity: 2926
Merit: 2091


Cashback 15%


View Profile
January 14, 2020, 10:41:51 AM
Merited by ABCbits (1)
 #5

Since segwit is a soft fork, what would happen if a miner treats some of the segwit outputs as anyone-can-spend scripts (as pre-seg scripts) and spend them in a new block?

SegWit-enabled nodes (ie. non-legacy nodes) will deem the transaction invalid and ignore it.

Legacy nodes (ie. ones that can't validate SegWit transactions as emphasized by nc50lc) will deem the transaction valid and fork off the main chain (assuming there's enough legacy nodes left to propagate this transaction amongst each other). Unless the majority of miners decide to follow this fork it will be orphaned rather quickly though.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
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!