Say I have a taproot address with a valid scriptpath (along with the mandatory keypath).
Is it possible to derive the witness program (schnorr signature of the taproot key) from the address?
Bitcoin Stack Exchange is a question and answer site for Bitcoin users, developers, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
The addresses used for P2TR outputs encode a version-1 witness program featuring the tweaked public key. This witness program can be derived from the address and thus is sufficient for a sender to pay the recipient.
In order to later make a keypath spend, the receiver will need to sign with the internal public key and apply the script tree's root as a tweak to the signature. If the receiver only knows the internal private key and the address, they will not be able to spend, since they cannot recalculate the tweak from that information if there is a meaningful script tree.
So, either the receiver must know at the least the root of the script tree, or the witness program must have been previously resolved by a scriptpath spend which would have revealed the script tree root.