Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-Chain Proof Generation & NEAR Client Enhancements #34

Merged
merged 14 commits into from
Jan 29, 2025
Merged

Conversation

r-near
Copy link
Collaborator

@r-near r-near commented Jan 28, 2025

This PR introduces support for generating and fetching cryptographic proofs across multiple chains, enhances NEAR client functionality, and adds Wormhole integration for cross-chain messaging.

Key Changes:

  1. EVM Proof Generation

    • Added Merkle proof generation for EVM transactions using @ethereumjs/mpt
    • Supports pre/post-Shapella and post-Dencun transactions
    • New getEvmProof utility generates receipts, logs, and header proofs
    • Comprehensive test suite with snapshot verification
  2. Wormhole Integration

    • Added VAA (Verified Action Approval) retrieval for cross-chain messages
    • Supports Mainnet/Testnet environments through Wormhole SDK
  3. NEAR Client Improvements

    • Automatic detection of mainnet/testnet environments
    • Enhanced logMetadata with transaction polling and event parsing
    • Returns MPC signatures for NEAR operations
    • Added proper type definitions for metadata events
  4. Core Enhancements

    • Network-specific RPC configuration for EVM chains (Eth/Base/Arb)
    • Added new dependencies: EthereumJS utilities, Wormhole SDK
    • Updated documentation with improved examples

Example Usage:

// Generate EVM proof for a transaction
const evmProof = await getEvmProof(txHash, ERC20_TRANSFER_TOPIC, ChainKind.Eth)

// Fetch Wormhole VAA
const vaa = await getVaa(txHash, "Mainnet")

// NEAR metadata logging with MPC signature
const { signature } = await nearClient.logMetadata("near:token.near")
const deployment = await ethClient.deployToken(signature, {
  token: "token.near",
  name: "My Token",
  symbol: "TKN",
  decimals: 18
})

Testing:

  • Added snapshot tests for EVM proof generation
  • Covered multiple transaction types and error cases
  • Verified NEAR event parsing with transaction polling

Notes:

  • NEAR logMetadata now returns structured event data instead of TX hash

Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: e64eb8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
omni-bridge-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@r-near r-near marked this pull request as ready for review January 28, 2025 05:13
@r-near r-near marked this pull request as draft January 28, 2025 05:13
@r-near r-near changed the title Support wormhole proof search Support Wormhole & EVM Proofs Jan 29, 2025
@r-near r-near changed the title Support Wormhole & EVM Proofs Cross-Chain Proof Generation & NEAR Client Enhancements Jan 29, 2025
@r-near r-near marked this pull request as ready for review January 29, 2025 05:50
@r-near r-near requested a review from kiseln January 29, 2025 05:54
@r-near r-near merged commit 0e1307d into main Jan 29, 2025
3 checks passed
@r-near r-near mentioned this pull request Jan 31, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant