Building StripSolvers: A Complete Guide to Extending StripChain’s Capabilities

6 min readMar 18, 2025

StripChain is an innovative blockchain network that leverages an intent-based architecture that removes the complexity of cross-chain operations. In this technical article, we learn how to create solvers for the StripChain network as we call them StripSolvers. These specialized middleware components are the backbone of StripChain’s ability to turn user intents into actual blockchain transactions across multiple networks. Rather than requiring users to understand the intricacies of different blockchain protocols, gas mechanisms, or contract interactions, StripSolvers handle all the complexity behind the scenes, allowing developers to focus on creating seamless cross-chain experiences. Whether you’re looking to monetize your blockchain expertise, extend your existing protocol’s reach, or contribute to the growing ecosystem of interoperable services, building a StripSolver offers an exciting opportunity to shape the future of blockchain interoperability.

StripSolvers are the core components of StripChain

What is a StripSolver?

A StripSolver is a specialized service in the StripChain ecosystem that fulfills user intents. Think of it as a middleware that sits between the user’s high-level intent (“I want to swap Token A for Token B”) and the low-level blockchain operations needed to make it happen.

Unlike traditional blockchain development like Ethereum, Solana, etc where users need to know exact contract addresses, gas parameters, and transaction formats, StripChain allows users to simply express what they want to accomplish. StripSolvers then handle all the complex details of executing these operations across various blockchains.

Why Build a StripSolver?

Building a StripSolver offers multiple advantages:

  1. Tap into the StripChain ecosystem: Your solver becomes part of a growing network of interoperable services.
  2. Monetize your expertise: If you have specialized knowledge of certain protocols or blockchains, you can build a solver that optimizes operations in that domain.
  3. Enhance your existing application: If you already have a product (like a DEX or lending protocol), building a solver allows it to interact with the broader StripChain network.
  4. Contribute to cross-chain innovation: Help build the future of blockchain interoperability.

How StripSolvers Work: The Technical Flow

A StripSolver operates within a clear protocol defined by StripChain. When a user submits an intent to StripVM (the unified execution layer), the intent is routed to the appropriate solver based on the operation type.

Let’s break down the flow:

  1. Intent Submission: A user submits an intent (e.g., “Swap 1 ETH for USDC”).
  2. StripVM Processing: The intent is validated and routed to the appropriate solver.
  3. Solver Execution: The solver processes the intent through a four-step flow (detailed below).
  4. Result Delivery: The operation result is returned to the user.

The key innovation here is that solvers can specialize in specific operations while maintaining a standardized interface with StripVM.

The Four-Step Solver Flow

Every StripSolver must implement four essential API endpoints that work together to process operations:

1. Construct: Building the Solution

POST /construct?operationIndex=<operation_index>

The construct phase is where your solver analyzes the intent and determines the best execution strategy. For example, a DEX aggregator solver would find the optimal route for a token swap across various liquidity sources.

Your solver needs to return data that will be signed by the user:

{
"dataToSign": "0x7a69f0..."
}

2. Solve: Executing with Signature

POST /solve?operationIndex=<operation_index>&signature=<signature>

Once the user signs the data, this endpoint is called to execute the actual blockchain transaction. Your solver broadcasts the transaction and returns a result identifier (usually a transaction hash):

{
"result": "0x8fd92c..."
}

3. Status: Monitoring Progress

POST /status?operationIndex=<operation_index>

StripVM calls this endpoint regularly to check if the operation is complete. Your solver must respond with one of three statuses:

{
"status": "pending|success|failure"
}

4. Output: Providing Results

POST /output?operationIndex=<operation_index>

Once the operation succeeds, this endpoint is called to retrieve the output data that might be needed for subsequent operations:

{
"output": "..."
}

Building Your First StripSolver: A Step-by-Step Guide

Now that you understand the fundamentals, let’s build a basic StripSolver. We’ll use Node.js for this example, but you can use any programming language.

Step 1: Set Up Your Project

mkdir my-stripsolver
cd my-stripsolver
npm init -y
npm install express body-parser axios ethers

Step 2: Create the Basic Server Structure

const express = require('express');
const bodyParser = require('body-parser');
const axios = require('axios');
const ethers = require('ethers');const app = express();
app.use(bodyParser.json());

const port = 3000;// Storage for operation data (use a database in production)
const storage = {
construct: {},
results: {},
outputs: {}
};
// Start server
app.listen(port, () => {
console.log(`StripSolver running on port ${port}`);
});

Step 3: Implement the Construct Endpoint

app.post('/construct', async (req, res) => {
try {
const intent = req.body;
const operationIndex = parseInt(req.query.operationIndex);

// Verify intent authenticity with StripVM
const authentic = await verifyIntent(intent);
if (!authentic) {
return res.status(400).json({ error: 'Invalid intent' });
}

// Get the operation details
const operation = intent.operations[operationIndex];
const metadata = JSON.parse(operation.solverMetadata);

// Here you would implement your solver-specific logic
// For this example, we'll simulate a simple ETH transfer
const dataToSign = ethers.utils.keccak256(
ethers.utils.defaultAbiCoder.encode(
['address', 'uint256'],
[metadata.recipient, ethers.utils.parseEther(metadata.amount)]
)
);

// Store for consistency
const operationId = `${intent.id}_${operationIndex}`;
storage.construct[operationId] = { dataToSign, metadata };

return res.json({ dataToSign });
} catch (error) {
console.error('Construct error:', error);
return res.status(500).json({ error: 'Internal server error' });
}
});

// Helper function to verify intent
async function verifyIntent(intent) {
try {
const response = await axios.post('https://api.stripvm.com/verifyIntent', intent);
return response.data.valid === true;
} catch (error) {
console.error('Intent verification error:', error);
return false;
}
}

Step 4: Implement the Solve Endpoint

app.post('/solve', async (req, res) => {
try {
const intent = req.body;
const operationIndex = parseInt(req.query.operationIndex);
const signature = req.query.signature;

// Verify intent
const authentic = await verifyIntent(intent);
if (!authentic) {
return res.status(400).json({ error: 'Invalid intent' });
}

const operationId = `${intent.id}_${operationIndex}`;
const constructData = storage.construct[operationId];

if (!constructData) {
return res.status(400).json({ error: 'Operation not found' });
}

// Here you would execute the transaction
// For this example, we'll simulate a transaction hash
const txHash = `0x${Math.random().toString(16).substring(2, 66)}`;

// Store the result and set initial status
storage.results[operationId] = { txHash, status: 'pending' };

// Simulate async processing (in a real implementation, you'd watch the blockchain)
setTimeout(() => {
storage.results[operationId].status = 'success';
storage.outputs[operationId] = JSON.stringify({
transferred: constructData.metadata.amount,
fee: '0.001'
});
}, 5000);

return res.json({ result: txHash });
} catch (error) {
console.error('Solve error:', error);
return res.status(500).json({ error: 'Internal server error' });
}
});

Step 5: Implement the Status Endpoint

app.post('/status', async (req, res) => {
try {
const intent = req.body;
const operationIndex = parseInt(req.query.operationIndex);

// Verify intent
const authentic = await verifyIntent(intent);
if (!authentic) {
return res.status(400).json({ error: 'Invalid intent' });
}

const operationId = `${intent.id}_${operationIndex}`;
const resultData = storage.results[operationId];

if (!resultData) {
return res.json({ status: 'pending' });
}

return res.json({ status: resultData.status });
} catch (error) {
console.error('Status error:', error);
return res.status(500).json({ error: 'Internal server error' });
}
});

Step 6: Implement the Output Endpoint

app.post('/output', async (req, res) => {
try {
const intent = req.body;
const operationIndex = parseInt(req.query.operationIndex);

// Verify intent
const authentic = await verifyIntent(intent);
if (!authentic) {
return res.status(400).json({ error: 'Invalid intent' });
}

const operationId = `${intent.id}_${operationIndex}`;
const output = storage.outputs[operationId];

if (!output) {
return res.status(400).json({ error: 'Output not found' });
}

return res.json({ output });
} catch (error) {
console.error('Output error:', error);
return res.status(500).json({ error: 'Internal server error' });
}
});

Best Practices for StripSolver Development

  1. Persistent Storage: Always use a reliable database for storing operation data.
  2. Idempotent Responses: Make sure your endpoints return consistent responses for the same inputs.
  3. Error Handling: Implement proper error handling for blockchain interactions.
  4. Intent Verification: Always verify intents with StripVM before processing.
  5. Monitoring: Set up monitoring for your solver to track performance and issues.
  6. Testing: Thoroughly test your solver with various intent scenarios.

Real-World Solver Examples

Let’s look at some potential real-world solvers:

DEX Aggregator Solver

This solver finds the best swap routes across multiple DEXes to optimize token swaps.

Bridge Solver

Specializes in cross-chain asset transfers, finding the most efficient bridging path.

Lending Protocol Solver

Manages deposits, withdrawals, and borrowing operations across various lending platforms.

NFT Marketplace Solver

Handles NFT purchases, listings, and transfers across multiple marketplaces.

Conclusion

StripSolvers are the execution engines that make cross-chain interoperability possible in StripChain. By building specialized solvers, developers can contribute to this ecosystem while monetizing their blockchain expertise. During the private beta phase, contact the StripChain team to get your solver whitelisted. As the network moves to an optimistic validation model, the process will become more decentralized.

Ready to start building? Check out our GitHub repository and join our Discord community to connect with other developers!

--

--

Mohammadreza Ashouri
Mohammadreza Ashouri

Written by Mohammadreza Ashouri

Mo has a Ph.D. in Compter Science. Mo specializes in Backend Programming and Security.

No responses yet