We develop escrow contracts that lock funds and release them only when predefined conditions are met. No intermediaries, full on-chain transparency. With over 50 successful projects, we know that the key is choosing the right verification mechanism and building defenses against typical attacks. Get a consultation — we will help determine the optimal architecture for your scenario.
A conditional payment is escrow on steroids. Funds are locked in the contract and released only when predetermined conditions are met. Sounds simple, but the devil is in the details: who verifies condition fulfillment, what happens in a dispute, how does the contract know about off-chain events? The last question makes this task non-trivial — a blockchain contract is isolated and cannot check 'task completed' or 'KPI achieved' by itself. It needs an oracle.
Why conditional payment requires an oracle?
The contract has no access to the outside world. If the condition is 'goods delivered' or 'result from a server', a trusted data source is needed by both parties. There are three options: centralized arbitrator, decentralized oracle (Chainlink), or cryptographic signature from a pre-agreed verifier. Each dictates the architecture and trust level.
How to choose a verification mechanism?
| Mechanism | Trust | Complexity | Use Case Example |
|---|---|---|---|
| Arbitrator (trusted third party) | Centralized | Low | B2B contracts, freelance payments |
| Chainlink Oracle (Price Feed / Functions) | Decentralized | Medium | DeFi options, KPI payments |
| Cryptographic signature | Decentralized (key) | Low | Payments with off-chain confirmation |
| Multi-party verification (2-of-3) | Distributed | High | Auctions, high-risk scenarios |
Arbitrator (trusted third party)
Classic escrow: buyer, seller, arbitrator. The arbitrator is an address with the right to call release() or refund(). The simplest implementation suitable for most B2B cases. Problem: the arbitrator is centralized — if it's a single address, it's a single point of failure and trust. Solution: use a multisig or DAO as the arbitrator.
Oracle (Chainlink or custom)
For conditions that can be obtained on-chain: asset price, event result, on-chain data from another protocol. Chainlink AnyAPI allows requesting any HTTP data and delivering it to the contract.
// Request data via Chainlink Functions
function requestVerification(bytes32 jobId, string calldata apiUrl) external {
Chainlink.Request memory req = buildChainlinkRequest(
jobId, address(this), this.fulfill.selector
);
req.add("get", apiUrl);
req.add("path", "result.completed");
sendChainlinkRequest(req, fee);
}
function fulfill(bytes32 requestId, bool completed) external recordChainlinkFulfillment(requestId) {
if (completed) {
_releaseFunds();
}
}
For simple numeric conditions (price threshold) — Chainlink Price Feeds without additional integration.
Recipient's signature (cryptographic proof)
The condition is confirmed by a digital signature from a trusted party. For example, a payment system signs a transaction confirmation, and the contract verifies the signature via ecrecover. This works without an on-chain oracle — the signature contains all necessary information.
function releaseWithSignature(
uint256 paymentId,
bytes memory signature
) external {
bytes32 hash = keccak256(abi.encodePacked(paymentId, address(this)));
bytes32 ethHash = hash.toEthSignedMessageHash();
address signer = ethHash.recover(signature);
require(signer == trustedVerifier, "Invalid signature");
_release(paymentId);
}
Multi-party verification
Combination: 2-of-3 between buyer, seller, and arbitrator. Any two of three can release funds. This reduces the risk of collusion between one party and the arbitrator.
Dispute resolution mechanism
We implement a dispute mechanism with evidence storage (IPFS hashes in the contract). Each party can upload a hash of their claim, and the arbitrator (or DAO) decides based on this data. The dispute window is limited — for example, 7 days.
Basic contract structure
struct Payment {
address payer;
address payee;
uint256 amount;
address token; // address(0) for ETH
uint256 deadline; // timestamp expiry
PaymentState state; // Pending, Released, Refunded, Disputed
bytes32 conditionHash; // hash of condition (off-chain document)
}
enum PaymentState { Pending, Released, Refunded, Disputed }
The deadline is critical. If the condition is not met by deadline, the payer must be able to reclaim funds. Without it, funds can be stuck forever.
How to implement a conditional payment: 5 steps
- Scenario analysis. Identify participants, condition, and verification mechanism. For example, a KPI payment needs an oracle; freelance needs an arbitrator.
- Contract design. Choose the pattern (arbitrator, oracle, signature) and set parameters: deadline, token, amount.
- Implementation. Write Solidity code using Foundry or Hardhat. Include tests with >95% coverage.
- Security audit. Check for reentrancy, oracle manipulation, front-running. Use Slither and Echidna.
- Deployment and monitoring. Deploy to testnet, run integration tests, then mainnet.
Typical cases and their specifics
From our practice:
- Freelance payment. Condition: client confirmation. Arbitrator: DAO or multisig. Term: 14-30 days. Specifics: needs a dispute mechanism with evidence storage.
- DeFi option. Condition: price level reached. Oracle: Chainlink Price Feed. Term: option expiry. Specifics: oracle manipulation risk — a flash loan can briefly change price. Solution: TWAP instead of spot price. On a recent DeFi options platform, we replaced spot price oracles with Chainlink TWAP. This reduced the risk of price manipulation by over 90% and lowered operational costs by 30%.
- Vendor payment with KPI. Condition: on-chain data (TVL, transaction volume). Oracle: The Graph + custom oracle. Term: quarterly. Specifics: data from The Graph is pull, not push — the contract requests it via Chainlink.
- Gaming achievements. Condition: on-chain event in a game contract. Verification: direct call from the game contract.
How to protect against attacks?
Reentrancy on release. _release() transfers ETH or tokens. If the recipient is a contract, it can call _release() again. Protection: ReentrancyGuard from OpenZeppelin + checks-effects-interactions pattern (change state first, then transfer).
Oracle manipulation. An attacker uses a flash loan to manipulate the price on a DEX in one block — the oracle reads the manipulated price → condition met → funds released. For price conditions: use only Chainlink with TWAP, not DEX spot price.
Front-running on fulfill. MEV bots see a fulfillment transaction in the mempool and insert their transaction before it. For escrow this is usually not critical (the recipient is predetermined), but in auction schemes a commit-reveal mechanism is needed.
Deadline expiry with valid condition. The condition is met, but the confirmation transaction gets stuck and the deadline passes. We implement a reasonable grace period or off-chain monitoring with alerts.
What's included in the deliverables
- Requirements audit and refinement for your business scenario.
- Smart contract source code in Solidity (Foundry/Hardhat) with unit and integration tests (>95% coverage).
- API documentation and interaction diagrams.
- Deployment to testnet (Sepolia, Goerli), full test round.
- Operation and maintenance instructions.
- Code review by our senior engineer (extensive blockchain experience).
We support projects after deployment: monitoring, contract upgrades if needed. We will assess your project within 24 hours. Contact us for a consultation. Order development — we will discuss details. Get a consultation to determine the architecture and budget estimate.
Timelines
| Stage | Duration |
|---|---|
| Basic escrow (ETH/ERC-20, arbitrator, deadline) | 2 days |
| Adding Chainlink Price Feed | +1 day |
| Adding Chainlink Functions | +2 days |
| Multi-party dispute mechanism with IPFS | +2 days |
| Full system with frontend | +3-5 business days |
Exact timeline is determined after analyzing your scenario.







