Apps
Charms exist to make programmable tokens (and any other kinds of apps) possible on Bitcoin.
So, what are Charms apps?
Here’s a high level code of such app:
Get full example by running:
app_contract
is the predicate that needs to be satisfied by the transaction. If all such predicates (for all apps participating in the spell) are satisfied AND all pre-requisite transactions have correct spells, then and only then this transaction’s spell is correct.