nym on Nostr: You could use Bitcoin Script. // Main script OP_OVER OP_HASH160 ...
You could use Bitcoin Script.
// Main script
OP_OVER OP_HASH160 <recipient_pubkey_hash> OP_EQUALVERIFY OP_DEPTH 0 OP_GREATERTHAN
OP_IF
<verify_nostr_event>
OP_VERIFY
<unlock_utxo>
OP_ELSE
OP_RETURN
OP_ENDIF
// <verify_nostr_event>
<push_event_id> <push_event_pubkey> <push_event_content> OP_CAT OP_HASH256
<push_event_signature> OP_SWAP OP_CHECKSIG
OP_VERIFY
<check_event_conditions>
OP_BOOLAND
// <check_event_conditions>
// Example condition: check if the event content contains a specific string
<push_expected_string> <push_event_content> OP_SWAP OP_SUBSTR OP_NIP OP_EQUALVERIFY
// <unlock_utxo>
// Example: Unlock the UTXO by sending the funds to a specific address
<push_destination_address> OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG
Published at
2024-03-30 15:18:33Event JSON
{
"id": "1aafeabc10fd8a6cd09473e5ee3f676d037e225c1cb5fba8080efca4a702da50",
"pubkey": "bcea2b98506d1d5dd2cc0455a402701e342c76d70f46e38739aadde77ccef3c9",
"created_at": 1711811913,
"kind": 1,
"tags": [
[
"e",
"4b2d8f676c0f7bea2b148e21a5326df5a75717980c8f8a1d7e7f96110d652f99",
"",
"root"
],
[
"e",
"ffe29e7ff97b05312dd7f977da3938dbe45276a1abfc5c61cfb2a677e0222d24",
"",
"reply"
],
[
"p",
"460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c"
],
[
"p",
"8aef75ca27af00a6f70c14865ae52860ccdc368f46499c7cf6b2352b09a709f5"
]
],
"content": "You could use Bitcoin Script. \n\n// Main script\nOP_OVER OP_HASH160 \u003crecipient_pubkey_hash\u003e OP_EQUALVERIFY OP_DEPTH 0 OP_GREATERTHAN\nOP_IF\n \u003cverify_nostr_event\u003e\n OP_VERIFY\n \u003cunlock_utxo\u003e\nOP_ELSE\n OP_RETURN\nOP_ENDIF\n\n// \u003cverify_nostr_event\u003e\n\u003cpush_event_id\u003e \u003cpush_event_pubkey\u003e \u003cpush_event_content\u003e OP_CAT OP_HASH256\n\u003cpush_event_signature\u003e OP_SWAP OP_CHECKSIG\nOP_VERIFY\n\u003ccheck_event_conditions\u003e\nOP_BOOLAND\n\n// \u003ccheck_event_conditions\u003e\n// Example condition: check if the event content contains a specific string\n\u003cpush_expected_string\u003e \u003cpush_event_content\u003e OP_SWAP OP_SUBSTR OP_NIP OP_EQUALVERIFY\n\n// \u003cunlock_utxo\u003e\n// Example: Unlock the UTXO by sending the funds to a specific address\n\u003cpush_destination_address\u003e OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG",
"sig": "602e577ee2a09c255bffd8bb21040f3e32b9293a43293306828102f7146a5c76e52c7a845678e60e91596567eb8824085015b8110d382a0d1875549710861c00"
}