PROTOCOL / COMPLETE ARCHITECTURE

How it works

ATOMIC CPI WRAPPER / JRC1

h/monhook brings coin launches, market discovery and transaction limits together on Solana. The supported trade path now uses h/monhook's own Guard on mainnet. Issuer options and optional confidential transfers are separate product layers, not features of the deployed Guard binary. The source and deployment page shows the exact relationship.

PROTOCOL AT A GLANCE

A simple rule: the trade must meet the limits you signed.

The protocol does not replace a launchpad, wallet or liquidity router. It gives those systems one shared language for declaring and enforcing a transaction outcome.

h/monhook separates declaration from enforcement. The current launcher can create a coin and export a local JLM1 policy plan; it does not publish that policy on-chain. For a supported Jupiter route, a trader can turn a quote into transaction limits, and the deployed Guard checks the realized result. A future publisher could make an issuer baseline discoverable to wallets.

The six components below describe one transaction lifecycle. JLM1 describes a launch plan, Intent V1 describes one trade, the deployed Guard executes it, JHK1 defines optional policy logic, JRC1 reports what settled, and the SDK assembles and reads the formats. Issuer options and Privacy Rings are separate integrations with their own contracts and trust boundaries.

JLM1 / LAUNCH Issuer baseline

Describes token identity, launch route and a local policy plan; the launcher does not publish it on-chain.

Intent V1 / INTENT User constraints

Binds authority, route, input ceiling, output floor, expiry and optional policy data.

DEPLOYED GUARD / PROGRAM Atomic enforcement

Checks preconditions, invokes the route through CPI and verifies realized balance deltas.

JHK1 / POLICY Composable rules

Allows an external program to accept or reject before and after route execution.

JRC1 / RECEIPT Settlement result

Returns the intent identity and measured input/output for wallets and indexers.

SDK / INTEGRATION Instruction assembly

Deduplicates accounts, encodes indexed routes and decodes successful receipts.

SPECIFICATION PUBLISHED IN REPOSITORY
PROGRAM + SDK H/MONHOOK GUARD / 11 SDK TESTS PASSING
DEVNET PROGRAM ID DjEzdqVd...cyT4ZQ7
MAINNET PROGRAM ID Be7RvxKN...1E2ELQ
VERIFIED H/MONHOOK GUARD DEPLOYMENT

The supported trade path uses Be7RvxKN...1E2ELQ on Solana mainnet. Its ProgramData matches SBF SHA-256 f90a8834...5ac9c3ac6f.

OPTIONAL PRIVACY

Privacy belongs to the user, not to hidden issuer promises.

Issuer protection is a separate contract flow: compare same-name launches, verify locked supply and option terms, and use independently reviewable evidence for any violation. The deployed Guard checks the outcome of a supported trade; it does not detect developer sales or exercise options.

Privacy Rings can provide optional confidential transfers of eligible assets. In the default Ring, asset and amount can be concealed while wallet addresses remain visible. A private transfer requires its own wallet approval; the current launcher and Guard do not create one. Lock collateral, strike, expiry and forfeiture evidence must remain verifiable.

A TRANSACTION IN PLAIN LANGUAGE

The router finds a path. The Guard checks whether its result is acceptable.

Suppose a wallet finds a route that may spend up to 1 SOL to buy a token. The user accepts only if at least 950,000 token units reach the destination account before a chosen expiry slot. The wallet encodes those limits and the selected route program into Intent V1, then asks the user to sign.

The deployed Guard records the source and destination balances, runs the router through CPI and reads the balances again. Spending 0.98 SOL and receiving 970,000 units passes. Spending 1.01 SOL or receiving 940,000 units fails. The program is not judging whether the quoted price was “good”; it is enforcing the exact boundary the user authorized.

SIGNED INTENT limits · expiry · route PRE HOOK policy may reject ROUTE CPI pump · dex · router POSTCONDITION reload balances COMMIT / REVERT JRC1 proof one atomic solana transaction
figure 1. the hook belongs to the transaction intent, not to a single liquidity pool.
Explore the technical protocol
CORE MECHANISM / DEPLOYED GUARD

Mint policy and transaction intent are complementary.

A Token-2022 Transfer Hook follows a mint. It is chosen by the issuer and runs whenever that token is transferred, regardless of which user initiated the transfer or why. That makes it useful for token-level behavior, but it cannot express the complete economic promise of a route involving several programs and assets.

A transaction-bound Intent Hook follows one user-approved transaction. It can protect a route that touches a router, multiple pools and either token program, because the final check looks at the complete realized input and output. The two mechanisms can coexist: a route may encounter a mint hook, while the deployed Guard still enforces the trader’s overall limit.

MINT SCOPE

Token-2022 Transfer Hook

Belongs to the mint and runs on each transfer. The issuer chooses it when the mint is created.

scope
one mint
authority
issuer
trigger
every transfer
TRANSACTION SCOPE

h/monhook Intent Hook

Belongs to one user transaction and protects a route across multiple programs, pools and token programs.

scope
one route intent
authority
trader
trigger
selected execution

The phase table below describes where a failure occurs. PRE rejects an invalid authorization before liquidity moves. EXECUTE propagates an error from the selected route. RELOAD reads the post-route token state. POST compares the realized result with the signed limits and runs any final policy. RETURN produces a compact receipt only after every condition succeeds.

phase on-chain action failure effect
PRE validate signer, expiry, route and optional policy program route never executes
EXECUTE invoke ordered route accounts through CPI route error propagates
RELOAD read classic SPL or Token-2022 account balances invalid owner rejected
POST enforce max input, min output and custom hook result transaction rolls back
RETURN emit JRC1 intent id, realized input and output portable proof
POLICY MODULES

Policies are composable programs.

The base protocol always protects authority, expiry, route identity, maximum input and minimum output. A policy module is for rules that are important to a particular application but should not be permanently hard-coded into the deployed Guard—for example an approved-route registry or a ceiling on additional token-level fees.

A policy does not receive unlimited authority to rewrite the trade. It receives the declared phase and its assigned accounts and data, then either accepts or returns an error. This keeps the core settlement invariant small while allowing applications to add rules that can be independently inspected and upgraded.

MAX COST

Reject when realized input exceeds the signed ceiling.

MIN OUTPUT

Reject when destination growth falls below the floor.

ROUTE REGISTRY

Accept only approved router or market identities.

TOKEN FEE CAP

Constrain Token-2022 economic effects.

COUNTERPARTY

Apply treasury or jurisdiction-specific rules.

CUSTOM HOOK

Pass an opaque payload to any JHK1 program.

SECURITY MODEL

Small invariants at the settlement boundary.

The wrapper measures realized state rather than trusting quoted or simulated output.

Security starts by narrowing what the deployed Guard promises. It can prove that the authorized route stayed inside measurable token-account limits; it cannot make an illiquid market liquid, verify an issuer’s marketing claims or protect a compromised wallet key. Keeping those boundaries explicit prevents a settlement guard from being mistaken for a universal token-safety system.

Enforced by the deployed Guard

  • Authority, expiry and route program validation.
  • Classic SPL and Token-2022 account ownership checks.
  • Integer balance deltas with checked arithmetic.
  • Maximum input and minimum output postconditions.
  • Policy hook rejection propagation.

Outside the wrapper

  • Price discovery and route optimization.
  • Liquidity availability and market volatility.
  • Token metadata accuracy and issuer representations.
  • Wallet security and user key management.
  • Independent review of third-party hook programs.
INTEGRATION SURFACE

Designed for wallets, launchers and routers.

Each integrator sees a different part of the same transaction. The current launcher creates an asset and exports a local policy plan. A supported wallet flow turns a Jupiter quote into terms the user can sign. The router supplies liquidity; the guard checks the result. Separate policy programs and indexers can consume the documented interfaces when integrated.

The format-driven design lets an application add a new route or policy without rewriting the settlement receipt. Support for a route is still adapter-specific; publication of a specification is not proof that every wallet, launchpad or router has integrated it.

consumer input output integration
wallet canonical intent constraints signable instruction Intent V1
launcher mint + market configuration local policy-plan preview JLM1
router ordered CPI accounts + data atomic route result execute_intent
policy program phase + opaque payload accept / reject JHK1
indexer transaction return data realized settlement record JRC1
PROTOCOL FAQ

Boundary and compatibility.

Is the deployed Guard a new AMM?

No. It is a route wrapper and settlement guard. Existing launchpads, AMMs and routers continue to provide liquidity and execution logic.

Does the wrapper custody tokens?

The base model measures user-controlled token accounts before and after CPI execution. It does not require a protocol-owned custody balance for ordinary settlement validation.

Can policy programs change the route?

A policy hook evaluates context and may accept or reject. The signed route program and ordered accounts remain explicit inputs to the guarded execution.

Read the implementation beside the specification.

Browse the complete Rust program, TypeScript SDK, tests, specification and CI configuration.

open source