stacks-network / stacks-core

The Stacks blockchain implementation
https://docs.stacks.co
GNU General Public License v3.0
3.01k stars 667 forks source link

PoX: Don't require Stacks AddressHashMode version bytes in `stacks-stack` #1902

Closed kantai closed 3 years ago

kantai commented 4 years ago

The stacks-stacks function requires that reward addresses provide a Stacks 2.0 AddressHashMode version byte. This constrains the kinds of Bitcoin addresses that may be used. We should probably dispense with these checks altogether, simply allowing any address to be provided.

When applying this update, we'll need to be careful to ensure that the stacks-node itself doesn't go crazy if an address is provided with an out-of-network version.

jcnelson commented 4 years ago

The biggest issue is knowing how to translate the address version into the corresponding scriptSig. Address versions effectively mandate a scriptSig template -- a version-0x00 address is a p2pkh scriptSig, and a version-0x05 address is a p2sh scriptSig. Future versions may mandate others, which may need to be considered as well (at the very least, maybe the on-chain voting procedure that Reed is working on could be appropriated to allow miners to specify and add in scriptSig templates for future versions?)

jcnelson commented 4 years ago

Discussion item: do we support bech32 addresses this way?

jcnelson commented 4 years ago

Discussion item: can we take an arbitrary scriptSig program, instead of an address?

jcnelson commented 3 years ago

The system is live now, so we can't change the PoX contract. I'm going to go ahead and close this in favor of #2441.