This is a simplified Agora offer which can only be accepted in "one shot", e.g. all or nothing. This is useful for offers that offer exactly one token, especially NFTs.
The covenant is reasonably simple, see this article for an explanation of the covenant mechanism, but uses two optimizations:
- It uses ANYONECANPAY as sighash for the "accept" path, which makes the sighash preimage start with 2000....00000, which can be created with OP_2 68 OP_NUM2BIN, saving around 64 bytes.
- It uses OP_CODESEPARATOR before the OP_CHECKSIG, which cuts out the entire script code, leaving only the OP_CHECKSIG behind. The scriptCode part in the BIP143 sighash now just becomes 01ac, which is both easier to deal with in the OP_SPLIT and also saves 100 bytes or so (depending on the enforced outputs).
Note: This currently doesn't add any functionality for discovering trades on the blockchain, which will be done in a future diff.
Depends on D16081.