A P2ST Address with a Template in the Scriptsig
This example does not go through the entire execution process, its purpose is to show how a custom template (not a well-known template) looks in the Locking Script and Unlocking Script compared to the Basic Script Template Execution Example (Basic P2ST address) example which uses a well-known template.
Context
Real transaction found here This transaction is an NFT sale contract from the Nebula Dex. In this contract a buyer is buying an NFT that seller has already put an NFT into the sale contract.
The contract address is nexa:npgsq9yj7xf4q3z0elzcfvctq0r8szfxkntvujq5k3e2yekshkyuzdcx5sfjena3da7rh87tqdqyyrepqgmjuy2vj0n5z2fd6k64yfaxum7aljnmlg336ccz7dt4ufm97zscwfek7zrz0
Locking Script
Reminder: The Locking Script fields are [group id, group amount, template hash, Hidden Args Hash, visible args...]
This addresses full Locking Script: 001492f19350444fcfc584b30b03c6780926b4d6ce4814b472a266d0bd89c13706a4132ccfb16f7c3b9fcb0340420f2102372e114c93e741292dd5b55227a6e6fddfca7bfa231d6302f3575e2765f0a187
00 - no group
14 - template hash size (20 bytes) 92f19350444fcfc584b30b03c6780926b4d6ce48 - template hash
14 - Hidden Args Hash size (20 bytes) b472a266d0bd89c13706a4132ccfb16f7c3b9fcb - Hidden Args Hash
03 - visible arg 1 (size 3) 40420f - visible arg 1
21 - visible arg 2 (size 66) 02372e114c93e741292dd5b55227a6e6fddfca7bfa231d6302f3575e2765f0a187 - visible arg 2
Script Sig
Reminder: The Unlocking Script fields are [template script, Hidden Args, satisfier args]
Full Unlocking Script: 4c566c6c5279009c63030051147b827c7ea97e00cd8817005114896fcd191f585b87d6a3316deb04a755b639ae5b51cd8800cc789d02fa009502102796760222029f63022202776851cc9dc0009d75677b519d7b7bad75680000
4c - PUSHDATA 1 56 - size of template 6c6c5279009c63030051147b827c7ea97e00cd8817005114896fcd191f585b87d6a3316deb04a755b639ae5b51cd8800cc789d02fa009502102796760222029f63022202776851cc9dc0009d75677b519d7b7bad7568 - Script Template
00 - Hidden Args 00 - satsifier data