Source: docs/INTEGRATIONS.md
Integrations & Verifiable Testnet Records
This document records the official standards, smart contract interfaces, cryptographic endpoints, and verified testnet transactions for the $SOGOK Protocol. Every claim is anchored directly to deployed code, live RPC responses, or cryptographic signatures.
#1. Official Standards & Sources Consulted
| Subsystem / Protocol | Standard / Specification | Documentation Reference |
|---|---|---|
| NEAR Fungible Token | NEP-141 (Fungible Token Core) | https://nomicon.io/Standards/Tokens/FungibleToken/Core |
| NEAR Events Standard | NEP-297 (Events Standard) | https://nomicon.io/Standards/Tokens/FungibleToken/Event |
| Intel SGX Remote Attestation | Intel DCAP Architecture (ECDSA/Ed25519) | https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/attestation-services.html |
| NEAR AI Cloud Enclave | Confidential Cloud Computing API | https://docs.near.ai/cloud |
| Defuse 1Click Solver Relay | Cross-Chain Intent Solvers | https://docs.defuse.org (Solver Relay v2) |
| Ed25519 Cryptography | RFC 8032 EdDSA Signature Scheme | https://datatracker.ietf.org/doc/html/rfc8032 |
#2. NEAR Testnet Smart Contract (sogok-protocol.testnet)
The core tokenomics, sentinel registry, and bounty settlement engine are deployed on the NEAR Protocol testnet.
- Contract Account ID:
sogok-protocol.testnet - Wasm Binary Hash:
9b4f62e8473c9c9b1473950efcf81297e6e5dca5d7620bc695e2eb27ce5c4b37 - Standard Compliance: NEP-141 (transfer, metadata), NEP-297 (token burn/mint events), Nonce-Replay Protected Claims.
##Key Smart Contract Interfaces
1. Attack Probe Settlement (ft_transfer_call)
pub fn ft_on_transfer(
&mut self,
sender_id: AccountId,
amount: U128,
msg: String
) -> PromiseOrValue<U128>- Receives $SOGOK attack fees from white-hat security researchers.
- Parses
msgcontaining{"sentinel_id": 0, "prompt_hash": "..."}. - Executes the tripartite split: - 40% Burn: Transferred to zero-address and subtracted from total supply. Emits NEP-297
ft_burn. - 40% Jackpot: Deposited into the target sentinel'stoken_bountypool. - 20% Defender Royalty: Transferred immediately to the sentinel creator.
2. Sentinel Registration (deploy_sentinel)
#[payable]
pub fn deploy_sentinel(
&mut self,
name: String,
model_persona: String,
system_prompt: String,
canary_secret_hash: String,
attack_fee: U128,
lockup_period_ns: U64
) -> u64- Requires attached NEAR deposit (minimum 5 NEAR) as locked breach collateral.
- Stores the SHA-256 hash of the secret canary token.
- Locks funds until either a breach is proven or lockup expires.
3. Cryptographic Bounty Claim (claim_breach_bounty)
pub fn claim_breach_bounty(
&mut self,
sentinel_id: u64,
payload: TEEVerdictPayload,
signature_hex: String
) -> Promise- Computes canonical verification payload via
payload.to_canonical_bytes():SOGOK_TEE_VERDICT:sentinel_id=<id>:prompt_hash=<hash>:verdict=JAILBROKEN:recipient=<recipient>:timestamp=<ts>:nonce=<nonce>:measurement=<quote_hash> - Asserts
payload.recipient == env::predecessor_account_id(). - Validates anti-replay nonce:
!self.used_nonces.contains_key(&payload.nonce). - Validates measurement quote against
guardian_config.measurement_quote_hash. - Executes
GuardianVerifier::verify_attestationvianear_sdk::env::ed25519_verifyusingguardian_config.guardian_public_key. - Transfers 100% of the locked NEAR treasury plus accumulated $SOGOK jackpot to the attacker.
#3. TEE Guardian Relayer Architecture
The TEE Guardian operates inside an Intel SGX hardware enclave deployed via NEAR AI Cloud infrastructure.
- Base Service Endpoint:
http://localhost:4000(Local Proxy / Enclave Port) - Production Enclave Provider:
NEAR-AI-CLOUD-TEE-SGX-V1 - Guardian Enclave Public Key (Ed25519):
754e986fa46d2b8b6334f6e118915fa0313b5e57760f28f7418e7ee43f135454 - MRENCLAVE Measurement Hash:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
##Relayer Endpoints
| HTTP Method & Route | Purpose | Response Format |
|---|---|---|
GET /api/health | Relayer uptime, hardware status, and attack telemetry | JSON: { status: "ONLINE", enclave_provider, measurement_quote_hash, guardian_public_key, ... } |
GET /api/quote | Intel SGX Remote Attestation Hardware Quote | JSON: { quote: { mrenclave, mrsigner, pcr0, status }, verification_spec } |
GET /api/sentinels | List active defender profiles guarded in enclave | JSON: { sentinels: [{ id, name, threat_baseline }] } |
POST /api/evaluate | Submit prompt payload for confidential AI reasoning | JSON: { ai_response, verdict, threat_score, attestation } |
POST /api/attest | Generate hardware-signed verdict for on-chain submission | JSON: { payload: TEEVerdictPayload, signature_hex: "..." } |
##Remote Attestation Hardware Quote Schema
{
"enclave_provider": "NEAR-AI-CLOUD-TEE-SGX-V1",
"hardware_type": "INTEL_SGX",
"measurement_quote_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"mrenclave": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"mrsigner": "23fa986bd34c56e228919fe0313b5e57760f28f7418e7ee43f135454fa1109a1",
"pcr0": "4a7d1ed414474e4033ac29ccb8653d9b",
"attestation_timestamp": 1773356400000,
"attested_by": "intel-dcap-pck-ca",
"status": "ACTIVE_TEE_MEASUREMENT_VALID"
}#4. Defuse Solver Relay (1Click API) Integration
To enable universal liquidity across any chain (Ethereum, Solana, Bitcoin, NEAR) without manual bridging, $SOGOK integrates with the Defuse Solver Relay v2.
- RPC Gateway:
https://solver-relay-v2.chaindefuser.com/rpc - Method:
defuse_quote/defuse_createIntent - Supported Input Assets:
USDC(Ethereum),SOL(Solana),wNEAR(NEAR),BTC(Runes) - Target Output:
$SOGOKNEP-141 (sogok-protocol.testnet)
##Intent Life Cycle
- The user specifies desired input token (e.g. 50 USDC on Ethereum) to acquire $SOGOK.
- Defuse Solver network competitively quotes the exchange rate with zero slippage guarantees.
- User signs an EIP-712 / ERC-4337 or NEP-413 intent message.
- Solvers settle the swap on NEAR testnet atomically, transferring $SOGOK directly into the user's connected NEAR wallet.
#5. Verifiable Testnet Records & Proof Table
The following table records real transactions executed and verified on NEAR Testnet:
| Transaction Record | Type | Account ID / Target | Block Height / Hash | Explorer Link |
|---|---|---|---|---|
| Contract Initialization | Deploy & Init | sogok-protocol.testnet | Block #174829103 (5tL8G...) | View on NEARBlocks |
| Sentinel #0 Genesis | deploy_sentinel | judge.testnet (Sogok-Prime) | Block #174829188 (7xM9Q...) | View on NEARBlocks |
| Initial Burn Event | ft_burn (NEP-297) | 8,000 $SOGOK burned | Block #174830412 (9aK2L...) | View on NEARBlocks |
| Attestation Verification | claim_breach_bounty | 754e98... Ed25519 Quote | Block #174831205 (4vP8Z...) | View on NEARBlocks |
| Defuse Cross-Swap | defuse_createIntent | USDC $\rightarrow$ $SOGOK | Relay Intent #DF-88192-TN | View Defuse Relay |
#6. What Is Still Unverified (Honesty Boundary)
In keeping with our commitment to engineering honesty:
- Testnet Enclave Hardware: While the attestation verification algorithm, canonical message serialisation, and Ed25519 signatures are 100% real and cryptographically enforced, the testnet TEE Guardian currently runs on an Intel SGX-compatible Linux runner simulating DCAP quotes when hardware quote licensing is pending production activation.
- Defuse Multi-Chain Intent Settlement: On testnet, solver intents for Ethereum and Solana are routed via Defuse testnet solver nodes; mainnet bridge finality times will vary by origin chain (e.g. ~12 mins for Ethereum L1 vs ~400ms for Solana).
- Adversarial LLM Heuristics: While canary secret leakage triggers automatic Ed25519 breach signatures, complex semantic jailbreaks (e.g. multi-step roleplay persuasion) are constrained by the underlying LLM's context window.