Security

Sardine vs. Sift vs. Custom Go Rules: Fraud Engines for NIP Bank Transfers

C
Chidi OkekeVP of Frontend Engineering
October 22, 202616 min read
Sardine vs. Sift vs. Custom Go Rules: Fraud Engines for NIP Bank Transfers

NIBSS Instant Payments (NIP) settle irrevocably within seconds, making chargebacks impossible and turning Western fraud engines upside down. We evaluate Sardine, Sift, and a custom Go/Redis rule engine across latency, dollar costs, device telemetry, and local Nigerian fraud patterns.

Unlike Visa or Mastercard card transactions where you have 120 days to contest a fraudulent charge through chargeback mechanisms, NIBSS Instant Payments (NIP) in Nigeria are final and irrevocable. Once an outbound transfer leaves your core banking application, travels over the NIBSS switch, and hits a destination microfinance bank (MFB) account, those funds are gone. Fraudsters operating on Nigerian payment rails know this well: they use compromised credentials from SIM swaps or phishing kits, push $500 to $5,000 worth of Naira across 3 to 5 rapid transfers into fresh MFB accounts, and cash out through agent POS terminals within 180 seconds.

Evaluating risk on NIP transfers requires making an authorization decision in under 80 milliseconds. If your risk engine adds 300 milliseconds of overhead, your transaction processing pipeline breaches its SLA with core banking providers or downstream switches like Interswitch and Unified Payment.

Off-the-shelf fraud tools built for US/EU card-not-present (CNP) e-commerce often fail under these conditions. They rely heavily on credit bureau data, zip code matching (AVS), and long-window behavioral profiles that don't map to low-friction instant transfers. Below, we evaluate three real architecture paths for securing Nigerian transfer rails: Sardine, Sift, and a Custom Go Rule Engine backed by Redis sliding windows.

Diagram comparing fraud evaluation latency for Sardine, Sift, and an In-Process Go Engine during NIP instant transfer requests

The Nigerian Fraud Profile: Why Western Models Drift

To pick the right engine, you must understand the four primary threat vectors hit by modern Nigerian neobanks and payment infrastructure:

  1. SIM-Swap Account Takeover (ATO): Attackers clone or port a target's mobile line, reset the USSD/App PIN via SMS OTP, log in from a new device, and initiate NIP transfers. Device telemetry must catch hardware identifier changes, SIM serial changes (where accessible), or sudden location jumps instantly.
  2. Microfinance Bank Mule Networks: Fraudulent transfers rarely target tier-1 commercial banks like Zenith or GTBank. They route into newly created accounts at low-friction digital MFBs where KYC checks are weaker. Fraud engines need real-time aggregation of recipient account numbers, tracking transfer velocity directed at specific MFB routing codes (Sort Codes).
  3. Rapid Layering via Inter-App Transfers: Attackers push money through secondary wallets (e.g., wallet to digital MFB to crypto P2P escrow) within 60 seconds to break auditing trails.
  4. NDPR Compliance Boundaries: Storing raw PII, national identity numbers, or unencrypted account details in third-party SaaS platforms located in US/EU regions creates strict regulatory liabilities under the NDPR (Nigeria Data Protection Regulation). As detailed in our analysis of Blind Indexing for NDPR Compliance: Why Encrypted BVNs Break Postgres Indexes and How HMAC-SHA256 Fixes It, identity data must be masked or indexed deterministically before leaving your local VPC.

When choosing identity and verification stacks, tools like YouVerify vs Prembly vs Smile ID: Building a Multi-Provider Identity Verification Engine in Go handle onboarding KYC, but they do not evaluate transactional risk at the precise instant an outbound transfer execution trigger fires. That is where transaction risk engines come in.


Option 1: Sardine (Device Telemetry & Behavior Biometrics)

Sardine was engineered explicitly for instant settlement rails (ACH, Crypto, FedNow, and instant bank transfers). Its primary strength is deep mobile SDK telemetry. It captures screen interaction dynamics (typing rhythm, paste events, orientation angles), root/jailbreak detection, remote control app flags (e.g., AnyDesk, TeamViewer running during a transfer), and SIM swap signals.

Strengths

  • Out-of-the-box ATO detection: Sardine flags active voice calls during transfers and remote desktop software commonly used in social engineering scams across Nigeria.
  • Built-in Device Fingerprinting: Very high accuracy across low-cost Android devices prevalent in Africa (Tecno, Infinix, Transsion devices) where generic browser fingerprints change randomly due to OS customizations.
  • Low-latency rules engine: Custom rules fire in under 60ms globally when using regional POPs.

Drawbacks

  • USD Billing Scale: Sardine's base tiers start at $2,000–$5,000 USD monthly platform fees plus usage costs per API call. For a Nigerian fintech processing 500,000 transfers monthly at low average order values, paying FX-indexed pricing in USD wrecks unit economics.
  • Cold Start on Local MFB Networks: Sardine’s global ML models lack context on local Nigerian bank routing behavior. You must manually program custom rules to flag suspicious velocity to specific MFB clearing codes.

Consult Sardine's fraud API documentation for integration architecture details on mobile telemetry SDK bindings.


Option 2: Sift (Machine Learning & Identity Network)

Sift (formerly Sift Science) relies heavily on global network cross-merchant intelligence and supervised machine learning models. Every transaction generates a score from 0 to 100 based on historical patterns seen across Sift’s global client base.

Strengths

  • Mature UI & Investigation Workflows: Sift’s console allows compliance and fraud analyst teams to visually trace fraud rings, link accounts by IP/device, and manually review flagged transactions without writing code.
  • Flexible Workflows: Excellent event-driven hooks ($transaction, $create_order, $update_account) with automated decision webhooks.

Drawbacks

  • CNP Machine Learning Bias: Sift’s core ML models were trained on global credit card chargebacks. In Nigeria, card chargebacks are secondary to instant account-to-account drain. Sift's default ML models will struggle with high false-positive rates on legitimate high-velocity NIP transactions unless you supply thousands of historical fraud labels to retrain the model.
  • Network Latency: Calling Sift's /v205/events endpoint synchronously from AWS eu-west-1 or af-south-1 to Sift’s US servers adds 120ms–220ms of round-trip network latency to every single transfer authorization.

Refer to Sift's Payment Protection API documentation for details on their scoring pipeline.


Option 3: Custom Go Rule Engine + Redis Sliding Windows

For engineering teams operating at high scale, building an in-process, deterministic Go rule engine backed by an in-memory database like Redis provides sub-10ms decision times, complete data sovereignty under NDPR, and zero USD SaaS overhead.

Instead of relying on black-box ML, a custom engine evaluates explicit behavioral boundaries:

  1. Has this user sent money to > 3 distinct new MFB destination accounts in the past 10 minutes?
  2. Is the current transaction amount 5x greater than the user's 30-day average transaction size?
  3. Did the login session originate from a new device_id within 15 minutes of a PIN reset event?

Strengths

  • Sub-10ms Latency: Embedded directly in your Go payment service, using local Redis clusters or in-memory caches.
  • Zero Foreign Currency Spend: Infrastructure runs on your existing AWS/Hetzner nodes. Costs scale strictly with server RAM.
  • Complete Local Rule Tailoring: Directly parse NIBSS bank codes, USSD session indicators, and specific Nigerian bank routing channels in real time.

Drawbacks

  • No Device Telemetry Out of the Box: You must build or integrate basic device fingerprinting (capturing IMEI hashes, MAC/IP subnets, OS versions) yourself.
  • Engine Optimization Overhead: Maintenance falls entirely on your engineering team. You must write efficient sliding-window aggregations in Lua or Redis commands to prevent memory leaks under high transaction concurrency.

Head-to-Head Comparison

| Criteria | Sardine | Sift | Custom Go Rule Engine | | :--- | :--- | :--- | :--- | | Primary Focus | Device biometrics & instant settlement risk | CNP card fraud & ML identity graph | Deterministic velocity & custom domain logic | | NIP Rail Suitability | High (Great for ATO & device swap detection) | Medium (Requires significant custom ML retraining) | High (Tailored specifically to local routing) | | P99 Response Latency | ~65ms – 110ms | ~140ms – 250ms | < 8ms (In-process evaluation) | | Pricing Model | USD Monthly commitment ($2,000+) + usage | USD Usage-based tiers | $0 SaaS cost (Standard server RAM/CPU) | | NDPR Compliance Effort | Medium (Requires PII hashing before ingest) | Medium (Requires strict data masking) | Zero External PII Exposure (Data stays in VPC) | | Device Telemetry | Advanced (Biometrics, active call, remote desktop) | Basic (Device fingerprinting) | Minimal (Requires client-side instrumentation) | | Rule Adjustment Speed | Fast (Dashboard rule builder) | Fast (Visual workflow editor) | Re-deployment or dynamic expression engine reload |


Implementation: High-Performance Go Rule Engine with CEL

Below is a production-grade pattern for an in-process fraud engine in Go. It uses Google's Common Expression Language (CEL) to evaluate rules dynamically without compiling Go code, while querying Redis for rolling 10-minute transfer velocity.

package main

import (
	"context"
	"fmt"
	"log"
	"time"

	"github.com/google/cel-go/cel"
	"github.com/google/cel-go/checker/decls"
	"github.com/redis/go-redis/v9"
)

type TransferContext struct {
	SenderUserID       string
	DestinationBankCode string
	AmountNaira        float64
	Velocity10Min      int64
	IsNewDevice        bool
	MinutesSincePinReset int
}

// EvaluateTransfer evaluates fraud rules in under 5ms using CEL and Redis counters
func EvaluateTransfer(ctx context.Context, rdb *redis.Client, tx TransferContext) (bool, string, error) {
	// 1. Fetch real-time velocity key from Redis (Rolling 10-minute window)
	velKey := fmt.Sprintf("tx_vel:%s", tx.SenderUserID)
	now := time.Now().Unix()
	windowStart := now - 600 // 10 minutes ago

	// Clean old entries and add current attempt inside a Redis pipeline
	pipe := rdb.Pipeline()
	pipe.ZRemRangeByScore(ctx, velKey, "0", fmt.Sprintf("%d", windowStart))
	pipe.ZAdd(ctx, velKey, redis.Z{Score: float64(now), Member: fmt.Sprintf("%d", now)})
	pipe.ZCard(ctx, velKey)
	pipe.Expire(ctx, velKey, 10*time.Minute)
	
	cmds, err := pipe.Exec(ctx)
	if err != nil {
		return false, "", fmt.Errorf("redis pipeline failed: %w", err)
	}
	tx.Velocity10Min = cmds[2].(*redis.IntCmd).Val()

	// 2. Define dynamic evaluation environment
	env, err := cel.NewEnv(
		cel.Declarations(
			decls.NewVar("velocity_10m", decls.Int),
			decls.NewVar("amount", decls.Double),
			decls.NewVar("bank_code", decls.String),
			decls.NewVar("is_new_device", decls.Bool),
			decls.NewVar("min_since_pin_reset", decls.Int),
		),
	)
	if err != nil {
		return false, "", fmt.Errorf("failed to build CEL env: %w", err)
	}

	// Example Rule: Block if new device + pin reset within 30 mins OR velocity > 4 transfers to high-risk MFB
	ruleExpr := `(is_new_device && min_since_pin_reset < 30) || (velocity_10m > 4 && (bank_code == "50515" || bank_code == "090110")) || (amount > 500000.0 && velocity_10m > 2)`

	ast, iss := env.Compile(ruleExpr)
	if iss.Err() != nil {
		return false, "", fmt.Errorf("rule compilation issue: %w", iss.Err())
	}

	program, err := env.Program(ast)
	if err != nil {
		return false, "", fmt.Errorf("program construction failed: %w", err)
	}

	// 3. Execute evaluation
	out, _, err := program.Eval(map[string]interface{}{
		"velocity_10m":        tx.Velocity10Min,
		"amount":              tx.AmountNaira,
		"bank_code":           tx.DestinationBankCode,
		"is_new_device":       tx.IsNewDevice,
		"min_since_pin_reset": tx.MinutesSincePinReset,
	})
	if err != nil {
		return false, "", fmt.Errorf("evaluation error: %w", err)
	}

	isFraudulent, ok := out.Value().(bool)
	if ok && isFraudulent {
		return true, "RULE_VIOLATION_HIGH_RISK_TRANSFER", nil
	}

	return false, "APPROVED", nil
}

Recommendations: Which Engine Fits Your Strategy?

Early-Stage Fintechs & Wallets (< $2M Monthly Transfer Volume)

Build a Custom Go Rule Engine. Avoid sinking precious runway into USD SaaS contracts like Sardine or Sift. Combine local Redis sliding-window velocity checks with CEL expression matching. Implement hard logic: limit single-transfer velocity, force 2FA/biometric re-authentication on transfers exceeding standard profile thresholds, and strictly monitor newly added destination MFB accounts.

Growth-Stage Neobanks ($2M – $30M Monthly Volume Facing ATO Spikes)

Hybrid Model: Custom Go Engine + Sardine Telemetry. The main risk at this stage shifts from simple velocity spam to sophisticated SIM swaps and social engineering (remote screen sharing). Use Sardine strictly for frontend mobile SDK device intelligence during login and PIN entry. Pass Sardine’s device risk score into your local Custom Go Engine as a single integer payload, allowing your Go engine to make the final authorization call locally without external network lag.

Enterprise Switching & Infrastructure Providers (> $30M Monthly Volume)

Custom Engine with Machine Learning Sidecars. At high concurrency, external SaaS calls introduce unacceptable latency spikes and staggering vendor bills. Build an in-house analytics pipeline: log transaction telemetry asynchronously to ClickHouse, train local XGBoost models on historical local chargeback/loss labels, and deploy model inferencing via Rust or C++ microservices embedded in your local VPC network.


Frequently Asked Questions

Why are microfinance bank (MFB) account numbers targeted disproportionately for NIP fraud?

Digital MFBs in Nigeria offer fast, API-first onboarding designed to minimize friction. Fraudsters leverage this speed to systematically create thousands of synthetic accounts, transfer stolen funds from compromised primary bank accounts into these MFB accounts, and immediately execute P2P or POS withdrawals before compliance teams can trigger a manual NIBSS recall request.

How does dynamic rule evaluation in Go compare to offloading checks to external webhooks?

External HTTP calls to fraud vendors add a minimum of 60ms to 200ms of latency over internet transit, subject to TLS handshakes, DNS resolution, and global routing degradation. Dynamic expression engines (like Google CEL) evaluate rules in memory in under 1 millisecond. This gives payment processors room to execute complex database transactions within strict network SLAs.

Does using an external provider like Sift or Sardine violate the NDPR?

Not inherently, provided your integration hashes or encrypts personally identifiable information (PII) before sending payload telemetry across national borders. Sending raw BVNs, full names, or cleartext national identification numbers to foreign endpoints without explicit user consent or local data residency architecture creates major audit liabilities under the NDPR. Always run PII through a deterministic HMAC-SHA256 blind indexing layer before external ingestion.

Neobot Engineering Standard

Every system deployed by Neobot Tech incorporates enterprise baseline practices. We continuously audit our database topologies, REST API query paths, and frontend modular bundles to prevent latency spikes and ensure top-tier security posture.

Tags:#Security#Fintech#Fraud Prevention#Golang#Payment Rails#NDPR

Discussion

Comments Coming Soon

We are currently migrating our discussion engine to a new real-time database schema. Check back shortly to join the conversation.