Version: 0.1 (spec), 2026-05-22 Status: design — not yet built. Supersedes v1 (Sepolia escrow + wDCC ERC20).
The architecture for ETH users (Flow A, second path) reads:
ETH users route through Near Intent and a relay wallet, bridging assets to Miden via AggLayer. In both cases, the Transaction Kernel validates the proof, Pragma Oracle provides token prices, and basket tokens are minted natively on Miden as a private STARK-proven note.
ETH users receive assets via AggLayer BridgeAsset, automatically withdrawn to their EVM wallet by the relay wallet.
There are three components in that path:
v1 of darwin-relay was a workaround built during M2 when NEAR Intent
didn’t list Miden as a supported destination. It implemented a Sepolia-
side escrow that minted a wrapped basket-token ERC20 (wDCC) back to the
user — assets never actually crossed to Miden. With Brian’s mock 1Click
now live and the Bali agglayer reachable, the proposal’s native shape is
achievable, and v1’s wDCC ERC20 path becomes redundant.
v2 reshapes darwin-relay to be component (2) only — the Miden-side
custodial layer — and delegates the bridge transport to 1Click / AggLayer.
A single long-running Rust binary, darwin-relay-v2, that:
listens for inbound 1Click P2ID notes targeted at the relay wallet
-> consumes the note (asset arrives in the relay wallet's vault)
-> looks up the originating correlationId in 1Click status
-> submits atomic_deposit_note targeting the basket controller
-> records {correlationId, user_evm_addr, basket_symbol, basket_amount}
in the local store as the user's open position
accepts /v0/redeem requests (REST) referring to a stored position
-> submits atomic_redeem_note for that basket-token amount
-> consumes the controller's payout notes for each constituent
-> POSTs an outbound 1Click quote (Miden -> Sepolia native ETH)
-> creates the corresponding Miden BridgeOutV1 note
-> reports completion (Sepolia release tx hash) back to the requester
MIDEN_MASTER_SEED_HEX.Subscribes to the 1Click bridge’s /v0/status polling endpoint, watching
for SUCCESS deposits targeted at our relay wallet’s Miden id. On a hit:
correlationId and the
originating EVM address (refundTo in the 1Click quote).POST /v0/redeem with body { user_evm_addr, basket_symbol, basket_amount }:
basket_amount of basket_symbol in
the relay’s positions map./v0/quote to 1Click with originAsset=miden-testnet:eth and
recipient=user_evm_addr.For M3 we hard-code the constituent -> wei conversion. a future iteration reads live Pragma medians for accurate pro-rata.
table positions {
user_evm_addr TEXT primary key,
basket_symbol TEXT,
basket_amount NUMERIC,
inbound_correlation_id TEXT,
last_updated TIMESTAMP
}
table inbound_intents {
correlation_id TEXT primary key,
user_evm_addr TEXT,
basket_symbol TEXT,
amount_in NUMERIC,
status TEXT, -- QUOTED | NOTE_CONSUMED | DEPOSIT_SUBMITTED | SETTLED
created_at TIMESTAMP
}
The user enters their basket symbol before requesting the 1Click quote
from our frontend. The frontend posts the intent (basket symbol, user EVM
address, amount) to the relay, which returns a correlationId that the
1Click /v0/quote call then carries through. The 1Click recipient is
the relay wallet’s Miden id; the refundTo is the user’s EVM address;
the correlationId ties them together.
The 1Click tab (OneClickDepositPanel) currently:
recipient.v2 flips it to:
/v0/intents to darwin-relay-v2 first with { user_evm_addr, basket_symbol, amount_in }.{ correlation_id, relay_miden_address }.recipient = relay_miden_address and metadata
carrying the correlation_id./v0/deposit/submit to 1Click as today./v0/intents/<correlation_id> on darwin-relay-v2 for status
through SETTLED.darwin-sdk/rust/scripts/) — orthogonal.rebalance_via_uniswap.sh) — Flow B
rebalance leg, separate concern.DarwinStrategy registry (0x635E19c6…) — used for basket
config, not for the deposit path. Stays.src/service.rs, src/state.rs, the postgres
store). Strip the ETH escrow listener; add the Miden listener +
1Click client + outbound REST.