DEV Community

Daniel Ioni
Daniel Ioni

Posted on

πŸš€ Integrating Tari into MyZubster: A Complete Guide to On‑Chain Escrow, NFTs, and Smart Assets

πŸš€ Integrating Tari into MyZubster: A Complete Guide to On‑Chain Escrow, NFTs, and Smart Assets

How we added programmable assets and trustless escrow to a decentralized marketplace using Tari – the sidechain of Monero.
🧠 Why Tari?

MyZubster already had:

βœ… Monero for private payments

βœ… Kali Linux + DeepSeek AI for security

βœ… An escrow system with AI dispute resolution
Enter fullscreen mode Exit fullscreen mode

But we wanted on‑chain programmability – the ability to create smart contracts, NFTs with royalties, and trustless escrow without sacrificing privacy.

That's where Tari comes in.
What is Tari?

Tari is a programmable sidechain built on Monero. It inherits Monero’s privacy and security while adding:

βœ… Smart contracts (written in Rust)

βœ… NFTs with built‑in royalty logic

βœ… Multisig escrow for trustless settlements

βœ… Programmable assets (e.g., dividend‑paying tokens)

βœ… Confidential transactions (privacy by default)
Enter fullscreen mode Exit fullscreen mode

In this guide, I'll show you how we integrated Tari into MyZubster, from installation to API usage, and how you can do the same.
πŸ—οΈ Architecture
text

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ MyZubster + Tari β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Monero β”‚ β”‚ Tari β”‚ β”‚ MyZubster Gateway β”‚ β”‚
β”‚ β”‚ (Payments) β”‚ β”‚ (Smart) β”‚ β”‚ (Node.js) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ NFT β”‚ β”‚ Escrow β”‚ β”‚ AI + Security β”‚ β”‚
β”‚ β”‚ (Tari) β”‚ β”‚ (Multisig) β”‚ β”‚ (Kali + DeepSeek) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Components

Tari Base Node – syncs the blockchain and validates transactions

Tari Console Wallet – manages keys, balances, and smart contracts

Tari RPC – allows MyZubster to interact with the wallet and node

tariService.js – our Node.js wrapper for Tari RPC

routes/tari.js – REST endpoints for NFT minting, escrow, and balances
Enter fullscreen mode Exit fullscreen mode

πŸ”§ 1. Installing Tari
Prerequisites
bash

System dependencies

apt update
apt install build-essential cmake git libssl-dev pkg-config protobuf-compiler -y

Install Rust
bash

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Build Tari from Source
bash

cd ~
git clone https://github.com/tari-project/tari.git
cd tari
cargo build --release --bin minotari_node
cargo build --release --bin minotari_console_wallet

Note: Tari is a large project. Compilation can take 10–30 minutes and requires at least 4GB of RAM. If you have limited memory, add swap space.
Enter fullscreen mode Exit fullscreen mode

Verify Binaries
bash

ls -la ~/tari/target/release/minotari_node
ls -la ~/tari/target/release/minotari_console_wallet

πŸš€ 2. Running Tari
Start the Base Node (Testnet)
bash

nohup ~/tari/target/release/minotari_node \
--network testnet \
--log-config base_node \
--base-path ~/tari-data \

~/tari_node.log 2>&1 &

Start the Console Wallet
bash

nohup ~/tari/target/release/minotari_console_wallet \
--network testnet \
--password myzubster \
--wallet-file ~/tari-wallet \

~/tari_wallet.log 2>&1 &

Test RPC Connectivity
bash

curl -X POST http://localhost:12820/json_rpc \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"0","method":"get_balance"}' | jq '.'

If you see a result object (even with balance: 0), Tari is running.
πŸ“‚ 3. Tari Service (Node.js)

We created services/tariService.js to interact with Tari RPC:
javascript

// services/tariService.js
const axios = require('axios');

const TARI_WALLET_RPC = process.env.TARI_WALLET_RPC || 'http://localhost:12820/json_rpc';

async function tariWalletRequest(method, params = {}) {
const response = await axios.post(TARI_WALLET_RPC, {
jsonrpc: '2.0',
id: '0',
method,
params
});
return response.data.result;
}

// Wallet functions
async function getBalance() {
return tariWalletRequest('get_balance');
}

// NFT functions
async function mintNFT(name, description, owner, metadata = {}) {
return tariWalletRequest('mint_nft', {
name,
description,
owner,
metadata: JSON.stringify(metadata)
});
}

// Escrow (multisig)
async function createEscrow(amount, buyer, seller, arbiter) {
return tariWalletRequest('create_multisig_escrow', {
amount,
buyer,
seller,
arbiter,
timeout: 7 * 24 * 60 * 60 // 7 days
});
}

module.exports = { getBalance, mintNFT, createEscrow, /* ... */ };

πŸ› οΈ 4. Tari API Endpoints

We added routes/tari.js to expose Tari functionality via REST:
Method Endpoint Description
GET /api/tari/balance Get wallet balance
POST /api/tari/nft/mint Mint a new NFT
POST /api/tari/nft/transfer Transfer NFT
POST /api/tari/escrow Create multisig escrow
POST /api/tari/escrow/release Release escrow funds
POST /api/tari/escrow/refund Refund escrow funds
Example: Minting an NFT
bash

curl -X POST http://localhost:3000/api/tari/nft/mint \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My First NFT",
"description": "A unique digital asset",
"metadata": {"assetType": "art", "value": 100}
}' | jq '.'

Example: Creating an Escrow
bash

curl -X POST http://localhost:3000/api/tari/escrow \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 10,
"buyer": "buyer_public_key",
"seller": "seller_public_key",
"arbiter": "admin_public_key"
}' | jq '.'

πŸ€– Integration with AI Dispute Resolution

When a dispute is opened, DeepSeek analyses the case and can trigger:

Release – funds are released to the seller via Tari multisig

Refund – funds are returned to the buyer

Escalate – human admin intervention
Enter fullscreen mode Exit fullscreen mode

The AI prompt includes:

Order details

Buyer/seller reputation scores

Payment status

Any uploaded evidence
Enter fullscreen mode Exit fullscreen mode

javascript

// services/disputeService.js (simplified)
async function resolveDisputeWithAI(escrowId) {
const escrow = await Escrow.findById(escrowId);
const prompt = ...; // full context
const decision = await deepseekService.askDeepSeek(prompt);

if (decision.decision === 'release') {
await tariService.releaseEscrow(escrow.tariEscrowId, adminKey);
} else if (decision.decision === 'refund') {
await tariService.refundEscrow(escrow.tariEscrowId, adminKey);
}
}

πŸ›‘οΈ Security Bot Monitoring

The Kali Linux security bot now monitors Tari escrows for anomalies:
python

def check_tari_escrow_anomalies():
resp = requests.get(f"{MYZUBSTER_API}/tari/escrow?status=disputed")
for e in resp.json():
prompt = f"Escrow {e['id']} has been disputed. Reputations: buyer={e['buyerRep']}, seller={e['sellerRep']}. Is this suspicious?"
analysis = ask_deepseek(prompt)
if "suspicious" in analysis.lower():
block_user(e['buyerId'])

πŸ“Š Current Status
Feature Status
Tari Node (testnet) βœ… Running
Tari Wallet βœ… Running
Tari RPC βœ… Accessible
NFT Minting βœ… Live
Multisig Escrow βœ… Live
AI Dispute Resolution βœ… Integrated
Security Bot Monitoring βœ… Integrated
Monero Mainnet ⏳ Next
πŸš€ Next Steps

Switch to Tari mainnet after testing

Add more NFT features (royalties, burning, marketplaces)

Integrate Tari with the order book – allow users to list NFTs for sale

Fractional ownership – split assets into fungible tokens
Enter fullscreen mode Exit fullscreen mode

πŸ’» Code & Demo

GitHub: DanielIoni-creator/MyZubsterGateway

Live Demo: https://myzubster.com
Enter fullscreen mode Exit fullscreen mode

πŸ’¬ Final Thoughts

Integrating Tari into MyZubster was a challenging but rewarding process. It adds a new layer of trustless automation – escrow, NFTs, and smart assets – all while preserving the privacy that Monero guarantees.

This is still early, but the foundation is solid. If you're building a marketplace, a DeFi app, or an NFT platform on Monero, Tari is the missing piece.

The excitement around MyZubster and Monero is real – and I'm thrilled to see where this ecosystem goes next.
🏷️ Tags

Tari #Monero #Blockchain #SmartContracts #NFT #Escrow #NodeJS #React #MongoDB #KaliLinux #DeepSeek #AI #OpenSource #MyZubster #BuildInPublic

Built with ❀️ by the MyZubster team.

Top comments (0)