Skip to content

Cross-chain conformance test suite #8

@truthixify

Description

@truthixify

Labels: Stellar Wave, test, interop, stellar, drips, help-wanted
Tier: L (1–2 weeks)
Type: test

Context

Each chain module in the SDK implements deriveStealthKeys, generateStealthAddress, scanAnnouncements, etc. — the same conceptual operations, adapted to each chain's curve and hashing. The tests for each chain live in isolation. There's nothing that verifies all four chains satisfy the same behavioral contract.

We want a parameterized test suite that runs every chain through the same scenarios.

Scope

Create test/conformance/ with a single test file that imports a chain module by name and runs a battery of operations:

The contract every chain must satisfy

// pseudo-code
for chain of ['evm', 'stellar', 'solana', 'ckb']:
  const m = chainModule(chain)

  test('round-trip: derive → encode → decode → match'):
    keys = m.deriveStealthKeys(TEST_SIGNATURE)
    metaAddress = m.encodeStealthMetaAddress(keys.spendingPubKey, keys.viewingPubKey)
    decoded = m.decodeStealthMetaAddress(metaAddress)
    assert decoded.spendingPubKey === keys.spendingPubKey
    assert decoded.viewingPubKey === keys.viewingPubKey

  test('stealth payment scan correctness'):
    generated = m.generateStealthAddress(keys.spendingPubKey, keys.viewingPubKey)
    announcement = mockAnnouncement(generated)
    matches = m.scanAnnouncements([announcement], keys.viewingKey, keys.spendingPubKey, keys.spendingKey)
    assert matches.length === 1
    assert matches[0].stealthAddress === generated.stealthAddress

  test('stealth private key spends'):
    p_stealth = m.deriveStealthPrivateKey(keys.spendingKey, generated.ephemeralPubKey, keys.viewingKey)
    pub = pointMul(p_stealth, G)
    assert pub === generated.stealthPubKey

  test('view-tag false-positive rate'):
    // 1000 random announcements not destined for us
    // assert ~ 1000/256 ≈ 4 pass the view-tag filter

Why parameterize

When a new chain (Hedera? Aptos?) is added, plugging it into the conformance harness immediately tells us if the implementation matches the protocol-level invariants. Right now we have no such safety net.

Things to avoid

  • Don't test chain-specific quirks here (e.g., StrKey encoding details). Those belong in the per-chain test directory.
  • Don't network-call. Conformance tests must be deterministic and offline.

Acceptance criteria

  • test/conformance/index.test.ts covering at least 8 conformance properties across all 4 chains.
  • Documentation in test/conformance/README.md explaining the contract.
  • Tests pass against current main; document any failures as findings (likely Solana, given it shares Stellar primitives).
  • When a new chain is added, the developer adds one entry in the chain registry and gets all conformance tests for free.

Files to start with

  • sdk/src/chains/{evm,stellar,solana,ckb}/index.ts for the exports surface
  • test/chains/*/e2e.test.ts for per-chain reference scenarios

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdripsFunded via Drips Networkhelp wantedExtra attention is neededinteropCross-chain / interoperabilitystellarTouches Stellar / Soroban codetestTest coverage / harness

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions