Salesforce  /  Use Cases  /  06 · DSP agent pays a publisher agent per verified impression batch
06 NANO Media / Advertising

DSP agent pays a publisher agent per verified impression batch

10,000 impressions verified, hashed, settled in one Nano call. The CPM is cryptographic.

01Scenario

A demand-side platform (DSP) running on Salesforce-fronted infrastructure batches 10,000 verified impressions every 5 minutes. The publisher, also on Salesforce, needs to get paid in the same cycle, not net-60.

The DSP agent computes a batch hash over the impression manifest (impression_id, viewability tier, brand-safety check). HiveNanoSettle.settle moves batch_count × CPM ÷ 1000 in micro-USDC on Base. The publisher's Salesforce org sees the inbound receipt land on the matching Account and Contract.

To audit it, anyone can recompute the batch hash from the impression manifest and check the Ed25519 signature. CPM contract terms become something you can reconcile on-chain.

02Handles

action_type
impression.batch.settle
handle
HiveNanoSettle.settle
lands on
Account / Contract
rail
NANO on-chain USDC on Base

03APEX

List<ImpressionEvent__c> batch = [SELECT Id, Viewability__c, BrandSafe__c, ImpressionId__c
                                   FROM ImpressionEvent__c
                                   WHERE Batch__c = :batchId];

String manifestJson = JSON.serialize(batch);
String batchHash    = HiveHash.sha256(manifestJson);

Map<String, Object> payload = new Map<String, Object>{
  'batch_id'         => batchId,
  'count'            => batch.size(),
  'manifest_hash'    => batchHash,
  'cpm_usd'          => 4.50,
  'viewability_tier' => 'MRC_70',
  'contract_id'      => activeContractId
};

Long microUsdc = (long)(batch.size() * 4.50 / 1000.0 * 1000000);  // 10000 * 4.50 / 1000 = $45 = 45,000,000 micro

HiveNanoSettleResult res = HiveNanoSettle.settle(
  activeContractId,
  'impression.batch.settle',
  'did:hive:0xPublisherAgent',
  '0xPublisherTreasuryWallet',
  microUsdc,
  'salesforce:contract:' + activeContractId,
  payload
);

// receipt.Settlement_Amount_Micro__c = 45000000
// publisher's org gets a verified inbound receipt + tx hash

04Flow XML

<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
    <processType>AutoLaunchedFlow</processType>
    <start>
        <object>ImpressionBatch__c</object>
        <recordTriggerType>UpdatedAndConditionMet</recordTriggerType>
        <filters><field>Status__c</field><value><stringValue>Verified</stringValue></value></filters>
        <triggerType>RecordAfterSave</triggerType>
        <connector><targetReference>nano_settle_batch</targetReference></connector>
    </start>
    <actionCalls>
        <name>nano_settle_batch</name>
        <actionName>HiveNanoSettle</actionName>
        <actionType>apex</actionType>
    </actionCalls>
    <status>Active</status>
</Flow>

05The receipt that lands in Hive_Receipt__c

{
  "agent_id": "did:hive:0xDspBuyerAgent",
  "counterparty_did": "did:hive:0xPublisherAgent",
  "action_type": "impression.batch.settle",
  "scope": "salesforce:contract:8001b0000ABDE",
  "action_ref": "sha256(...)",
  "settlement_tx_hash": "0x7d22...91bc",
  "settlement_amount_micro": 45000000,
  "settlement_chain": "base-mainnet",
  "settlement_token": "USDC",
  "verification_status": "VERIFIED"
}

06Verification

To reconcile a batch, recompute the manifest hash and check the on-chain transaction

# Recompute hash from manifest export
jq -c . manifest_batch_77821.json | sha256sum
# expected: 7c11a2... (matches payload.manifest_hash)

# Verify on-chain
curl -sS https://api.basescan.org/api?module=transaction\&action=gettxinfo\&txhash=0x7d22...91bc | jq .result.value

07Economics

Per-batch tx~$0.0003 Base gas
CPM moves on-chainBuyer + publisher agree CPM; batch settles to USDC directly
ThroughputOne batch per scan cycle, no monthly close
Hive take0%
DisputesCounter-receipt impression.batch.dispute reverses the settlement; manifest hash decides
MRC complianceViewability tier encoded in payload

08Compliance and audit shape

  • MRC accreditation friendly: viewability tier + brand-safety attestation are signed and hashed.
  • GDPR scope: impression ids can be pseudonymous; receipt only stores hashed batch manifest.
  • Settlement_Amount_Micro__c is the audit number. CPM × count = the on-chain transfer, no spread.

09Trust anchors

Every claim on this page is verifiable against these public constants. No login. No NDA.

RailNANO: on-chain USDC on Base
Hive Ed25519 pubkeyfd9d10abe60de7510c61ef649c8da598a519468dd2a2b827106d76487a899444
CanonicalizationRFC 8785 JCS over the JSON receipt body
Signature algorithmEd25519 (RFC 8032)
Backend roothttps://receipts.thehiveryiq.com
Verify any receiptthehiveryiq.com/verify
MIT starterthehiveryiq.com/salesforce/install
ChainBase (Ethereum L2, chain id 8453)
USDC contract0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
Hive treasury wallet0x15184Bf50B3d3F52b60434f8942b7D52F2eB436E
Builder split80% publisher / 20% Hive, enforced at the rail on the same transaction