Criterion 1: Constraints on State
Because early intent projects output transactions to be settled via imperative execution, they conceive of intents as constraints on state transitions. In declarative blockchains like Essential, intents exist not as constraints on the state transition function, but as constraints on state itself.
Leveraging constraints on state is a critical property of declarative blockchains, as it allows developers and users to “constrain” the solution space of acceptable (and optimal) outcomes.
Constraint Programming
To enable the enforcement of constraints on state, Essential’s architecture is based on constraint programming, a subset of the declarative programming paradigm.
Constraint programming is an extremely ergonomic approach to expressing and enforcing outcomes within state machines, and is especially useful for solving large-scale combinatorial problems—for example, finding a series of optimal state transitions among a complex on-chain solution space (i.e. solving intents).
When a user submits an intent, they are declaratively outlining a set of variables as well as constraints on those variables, narrowing down the space of feasible solutions.
Constraint Optimization: Maximizing Utility
The constraint-based model also enables users to specify an objective utility function, which represents their preferences and preference ordering.
Solvers can then attempt to solve a constraint optimization problem, which consists of maximizing the user’s utility (as described in the objective function outlined within the user’s intent). Solvers are not just trying to satisfy the user’s intent, but to maximize the user's utility with respect to their objective function.
Put more simply, solvers compete to answer the question: Given state X and objective function F, what new state Y maximizes the user’s satisfaction? The solution that results in the highest satisfaction can then be identified as the winning solution.
Constraints on State: Key Takeaway
Because declarative blockchains enable users to directly constrain state, no state transition may be included if it does not achieve the user’s intended outcome. Unlike imperative blockchains, there is no risk of state drift causing unintended outcomes or failed transactions.
Last updated