POL Price: $0.124245 (-2.63%)
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

1 address found via
Transaction Hash
Block
From
To
Set Stealth Keys819767152026-01-22 9:16:422 days ago1769073402IN
Umbra: Stealth Key Registry
0 POL0.035732479.88191548
Set Stealth Keys818226972026-01-18 19:42:466 days ago1768765366IN
Umbra: Stealth Key Registry
0 POL0.00834266112.02570979
Set Stealth Keys815774152026-01-13 3:26:2112 days ago1768274781IN
Umbra: Stealth Key Registry
0 POL0.01955569564.21511157
Set Stealth Keys815774092026-01-13 3:26:0912 days ago1768274769IN
Umbra: Stealth Key Registry
0 POL0.01980931571.5324185
Set Stealth Keys815774052026-01-13 3:26:0112 days ago1768274761IN
Umbra: Stealth Key Registry
0 POL0.04311737579.06763952
Set Stealth Keys815712712026-01-13 0:01:3312 days ago1768262493IN
Umbra: Stealth Key Registry
0 POL0.02363605317.47985802
Set Stealth Keys815577352026-01-12 16:20:0312 days ago1768234803IN
Umbra: Stealth Key Registry
0 POL0.04827591648.54734192
Set Stealth Keys815562782026-01-12 15:30:2012 days ago1768231820IN
Umbra: Stealth Key Registry
0 POL0.03216689432.13587217
Set Stealth Keys815513662026-01-12 12:46:3612 days ago1768221996IN
Umbra: Stealth Key Registry
0 POL0.03445358462.78102258
Set Stealth Keys815513392026-01-12 12:45:4212 days ago1768221942IN
Umbra: Stealth Key Registry
0 POL0.03505468470.78543637
Set Stealth Keys814771322026-01-10 19:32:0814 days ago1768073528IN
Umbra: Stealth Key Registry
0 POL0.00926717124.46012557
Set Stealth Keys814041782026-01-09 3:00:1816 days ago1767927618IN
Umbra: Stealth Key Registry
0 POL0.06035831810.74461618
Set Stealth Keys814041232026-01-09 2:58:2816 days ago1767927508IN
Umbra: Stealth Key Registry
0 POL0.06472036869.32487651
Set Stealth Keys811838052026-01-04 0:34:2921 days ago1767486869IN
Umbra: Stealth Key Registry
0 POL0.085330411,145.99
Set Stealth Keys808581652025-12-27 11:39:3328 days ago1766835573IN
Umbra: Stealth Key Registry
0 POL0.0065365387.78589421
Set Stealth Keys806189262025-12-21 22:44:2434 days ago1766357064IN
Umbra: Stealth Key Registry
0 POL0.0026652235.79409262
Set Stealth Keys806188932025-12-21 22:43:1834 days ago1766356998IN
Umbra: Stealth Key Registry
0 POL0.002635635.39629649
Set Stealth Keys805457422025-12-20 6:03:4636 days ago1766210626IN
Umbra: Stealth Key Registry
0 POL0.00427247123.30744042
Set Stealth Keys805457362025-12-20 6:03:3436 days ago1766210614IN
Umbra: Stealth Key Registry
0 POL0.0090458121.50339455
Set Stealth Keys805457242025-12-20 6:03:1036 days ago1766210590IN
Umbra: Stealth Key Registry
0 POL0.00372337107.39175791
Set Stealth Keys805457202025-12-20 6:03:0236 days ago1766210582IN
Umbra: Stealth Key Registry
0 POL0.00366239105.63287458
Set Stealth Keys805457162025-12-20 6:02:5436 days ago1766210574IN
Umbra: Stealth Key Registry
0 POL0.0071872596.51075181
Set Stealth Keys805435432025-12-20 4:50:2836 days ago1766206228IN
Umbra: Stealth Key Registry
0 POL0.0053303871.58727549
Set Stealth Keys805434502025-12-20 4:47:2236 days ago1766206042IN
Umbra: Stealth Key Registry
0 POL0.0052249970.18219071
Set Stealth Keys804544172025-12-18 3:19:1038 days ago1766027950IN
Umbra: Stealth Key Registry
0 POL0.0024368232.73153325
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions
Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StealthKeyRegistry

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 999999 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.7;

contract StealthKeyRegistry {
  // =========================================== Events ============================================

  /// @dev Event emitted when a user updates their registered stealth keys
  event StealthKeyChanged(
    address indexed registrant,
    uint256 spendingPubKeyPrefix,
    uint256 spendingPubKey,
    uint256 viewingPubKeyPrefix,
    uint256 viewingPubKey
  );

  // ======================================= State variables =======================================

  /// @dev The payload typehash used for EIP-712 signatures in setStealthKeysOnBehalf
  bytes32 public constant STEALTHKEYS_TYPEHASH =
    keccak256(
      "StealthKeys(uint256 spendingPubKeyPrefix,uint256 spendingPubKey,uint256 viewingPubKeyPrefix,uint256 viewingPubKey)"
    );

  /// @dev The domain separator used for EIP-712 sigatures in setStealthKeysOnBehalf
  bytes32 public immutable DOMAIN_SEPARATOR;

  /**
   * @dev Mapping used to store two secp256k1 curve public keys used for
   * receiving stealth payments. The mapping records two keys: a viewing
   * key and a spending key, which can be set and read via the `setStealthKeys`
   * and `stealthKey` methods respectively.
   *
   * The mapping associates the user's address to another mapping, which itself maps
   * the public key prefix to the actual key . This scheme is used to avoid using an
   * extra storage slot for the public key prefix. For a given address, the mapping
   * may contain a spending key at position 0 or 1, and a viewing key at position
   * 2 or 3. See the setter/getter methods for details of how these map to prefixes.
   *
   * For more on secp256k1 public keys and prefixes generally, see:
   * https://github.com/ethereumbook/ethereumbook/blob/develop/04keys-addresses.asciidoc#generating-a-public-key
   */
  mapping(address => mapping(uint256 => uint256)) keys;

  /**
   * @dev We wait until deployment to codify the domain separator because we need the
   * chainId and the contract address
   */
  constructor() {
    DOMAIN_SEPARATOR = keccak256(
      abi.encode(
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
        keccak256(bytes("Umbra Stealth Key Registry")),
        keccak256(bytes("1")),
        block.chainid,
        address(this)
      )
    );
  }

  // ======================================= Set Keys ===============================================

  /**
   * @notice Sets stealth keys for the caller
   * @param _spendingPubKeyPrefix Prefix of the spending public key (2 or 3)
   * @param _spendingPubKey The public key for generating a stealth address
   * @param _viewingPubKeyPrefix Prefix of the viewing public key (2 or 3)
   * @param _viewingPubKey The public key to use for encryption
   */
  function setStealthKeys(
    uint256 _spendingPubKeyPrefix,
    uint256 _spendingPubKey,
    uint256 _viewingPubKeyPrefix,
    uint256 _viewingPubKey
  ) external {
    _setStealthKeys(msg.sender, _spendingPubKeyPrefix, _spendingPubKey, _viewingPubKeyPrefix, _viewingPubKey);
  }

  /**
   * @notice Sets stealth keys for the registrant using an EIP-712 signature to
   * authenticate the update on their behalf.
   * @param _registrant The address for which stealth keys are being registered,
   * i.e. the address expected to be recovered from the provided signature
   * @param _spendingPubKeyPrefix Prefix of the spending public key (2 or 3)
   * @param _spendingPubKey The public key for generating a stealth address
   * @param _viewingPubKeyPrefix Prefix of the viewing public key (2 or 3)
   * @param _viewingPubKey The public key to use for encryption
   * @param _v ECDSA signature component: Parity of the `y` coordinate of point `R`
   * @param _r ECDSA signature component: x-coordinate of `R`
   * @param _s ECDSA signature component: `s` value of the signature
   */
  function setStealthKeysOnBehalf(
    address _registrant,
    uint256 _spendingPubKeyPrefix,
    uint256 _spendingPubKey,
    uint256 _viewingPubKeyPrefix,
    uint256 _viewingPubKey,
    uint8 _v,
    bytes32 _r,
    bytes32 _s
  ) external {
    // create EIP-712 Digest
    bytes32 _digest =
      keccak256(
        abi.encodePacked(
          "\x19\x01",
          DOMAIN_SEPARATOR,
          keccak256(
            abi.encode(
              STEALTHKEYS_TYPEHASH,
              _spendingPubKeyPrefix,
              _spendingPubKey,
              _viewingPubKeyPrefix,
              _viewingPubKey
            )
          )
        )
      );

    // recover the signing address and ensure it matches the registrant
    address _recovered = ecrecover(_digest, _v, _r, _s);
    require(_recovered == _registrant, "StealthKeyRegistry: Invalid Signature");

    // now that we know the registrant has authorized it, update the stealth keys
    _setStealthKeys(_registrant, _spendingPubKeyPrefix, _spendingPubKey, _viewingPubKeyPrefix, _viewingPubKey);
  }

  /**
   * @dev Internal method for setting stealth key that must be called after safety
   * check on registrant; see calling method for parameter details
   */
  function _setStealthKeys(
    address _registrant,
    uint256 _spendingPubKeyPrefix,
    uint256 _spendingPubKey,
    uint256 _viewingPubKeyPrefix,
    uint256 _viewingPubKey
  ) internal {
    require(
      (_spendingPubKeyPrefix == 2 || _spendingPubKeyPrefix == 3) &&
        (_viewingPubKeyPrefix == 2 || _viewingPubKeyPrefix == 3),
      "StealthKeyRegistry: Invalid Prefix"
    );

    emit StealthKeyChanged(_registrant, _spendingPubKeyPrefix, _spendingPubKey, _viewingPubKeyPrefix, _viewingPubKey);

    // Shift the spending key prefix down by 2, making it the appropriate index of 0 or 1
    _spendingPubKeyPrefix -= 2;

    // Ensure the opposite prefix indices are empty
    delete keys[_registrant][1 - _spendingPubKeyPrefix];
    delete keys[_registrant][5 - _viewingPubKeyPrefix];

    // Set the appropriate indices to the new key values
    keys[_registrant][_spendingPubKeyPrefix] = _spendingPubKey;
    keys[_registrant][_viewingPubKeyPrefix] = _viewingPubKey;
  }

  // ======================================= Get Keys ===============================================

  /**
   * @notice Returns the stealth key associated with an address.
   * @param _registrant The address whose keys to lookup.
   * @return spendingPubKeyPrefix Prefix of the spending public key (2 or 3)
   * @return spendingPubKey The public key for generating a stealth address
   * @return viewingPubKeyPrefix Prefix of the viewing public key (2 or 3)
   * @return viewingPubKey The public key to use for encryption
   */
  function stealthKeys(address _registrant)
    external
    view
    returns (
      uint256 spendingPubKeyPrefix,
      uint256 spendingPubKey,
      uint256 viewingPubKeyPrefix,
      uint256 viewingPubKey
    )
  {
    if (keys[_registrant][0] != 0) {
      spendingPubKeyPrefix = 2;
      spendingPubKey = keys[_registrant][0];
    } else {
      spendingPubKeyPrefix = 3;
      spendingPubKey = keys[_registrant][1];
    }

    if (keys[_registrant][2] != 0) {
      viewingPubKeyPrefix = 2;
      viewingPubKey = keys[_registrant][2];
    } else {
      viewingPubKeyPrefix = 3;
      viewingPubKey = keys[_registrant][3];
    }

    return (spendingPubKeyPrefix, spendingPubKey, viewingPubKeyPrefix, viewingPubKey);
  }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 999999
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"registrant","type":"address"},{"indexed":false,"internalType":"uint256","name":"spendingPubKeyPrefix","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"spendingPubKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"viewingPubKeyPrefix","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"viewingPubKey","type":"uint256"}],"name":"StealthKeyChanged","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STEALTHKEYS_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_spendingPubKeyPrefix","type":"uint256"},{"internalType":"uint256","name":"_spendingPubKey","type":"uint256"},{"internalType":"uint256","name":"_viewingPubKeyPrefix","type":"uint256"},{"internalType":"uint256","name":"_viewingPubKey","type":"uint256"}],"name":"setStealthKeys","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registrant","type":"address"},{"internalType":"uint256","name":"_spendingPubKeyPrefix","type":"uint256"},{"internalType":"uint256","name":"_spendingPubKey","type":"uint256"},{"internalType":"uint256","name":"_viewingPubKeyPrefix","type":"uint256"},{"internalType":"uint256","name":"_viewingPubKey","type":"uint256"},{"internalType":"uint8","name":"_v","type":"uint8"},{"internalType":"bytes32","name":"_r","type":"bytes32"},{"internalType":"bytes32","name":"_s","type":"bytes32"}],"name":"setStealthKeysOnBehalf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_registrant","type":"address"}],"name":"stealthKeys","outputs":[{"internalType":"uint256","name":"spendingPubKeyPrefix","type":"uint256"},{"internalType":"uint256","name":"spendingPubKey","type":"uint256"},{"internalType":"uint256","name":"viewingPubKeyPrefix","type":"uint256"},{"internalType":"uint256","name":"viewingPubKey","type":"uint256"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b50604080518082018252601a81527f556d62726120537465616c7468204b65792052656769737472790000000000006020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f918101919091527f4baf469995623d4e8baaebc31ddb114fbc90e91c717e133da2fb936309b41eb9918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f1981840301815291905280516020909101206080526080516107fd61011c60003960008181608601526101b301526107fd6000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806367eaa7ac1161005057806367eaa7ac146100bb578063bb8f257b146100e2578063cec2a787146100f557600080fd5b8063100dcc531461006c5780633644e51514610081575b600080fd5b61007f61007a3660046106e2565b610128565b005b6100a87f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100a87fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c181565b61007f6100f0366004610757565b610352565b6101086101033660046106c0565b610365565b6040805194855260208501939093529183015260608201526080016100b2565b604080517fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c16020808301919091528183018a9052606082018990526080820188905260a08083018890528351808403909101815260c0830190935282519201919091207f190100000000000000000000000000000000000000000000000000000000000060e08301527f000000000000000000000000000000000000000000000000000000000000000060e283015261010282015260009061012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa15801561026d573d6000803e3d6000fd5b5050506020604051035190508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537465616c74684b657952656769737472793a20496e76616c6964205369676e60448201527f617475726500000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103468a8a8a8a8a6104b8565b50505050505050505050565b61035f33858585856104b8565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208181526040808320838052909152812054819081908190156103d95773ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320838052909152902054600294509250610410565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600184529091529020546003945092505b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600284529091529020541561047d57505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060028085529252909120546104b1565b505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060038085529252909120545b9193509193565b83600214806104c75750836003145b80156104dd575081600214806104dd5750816003145b610569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f537465616c74684b657952656769737472793a20496e76616c6964205072656660448201527f69780000000000000000000000000000000000000000000000000000000000006064820152608401610330565b60408051858152602081018590529081018390526060810182905273ffffffffffffffffffffffffffffffffffffffff8616907fe879dede910dd3b22239a11044df83c95adcd4b54003516f42866cc1fe4f0a199060800160405180910390a26105d4600285610789565b73ffffffffffffffffffffffffffffffffffffffff86166000908152602081905260408120919550610607866001610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff881681529182905281209061064a846005610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff979097168752868252808720958752949052838520929092558352912055565b803573ffffffffffffffffffffffffffffffffffffffff811681146106bb57600080fd5b919050565b6000602082840312156106d257600080fd5b6106db82610697565b9392505050565b600080600080600080600080610100898b0312156106ff57600080fd5b61070889610697565b97506020890135965060408901359550606089013594506080890135935060a089013560ff8116811461073a57600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806000806080858703121561076d57600080fd5b5050823594602084013594506040840135936060013592509050565b6000828210156107c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea264697066735822122019870f8b68c2a38dd8e08e0d8a59cc5dc5dff5338d8558eb989712ca985661e664736f6c63430008070033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100675760003560e01c806367eaa7ac1161005057806367eaa7ac146100bb578063bb8f257b146100e2578063cec2a787146100f557600080fd5b8063100dcc531461006c5780633644e51514610081575b600080fd5b61007f61007a3660046106e2565b610128565b005b6100a87fecad5adf2e2669f8deb31b6e606560fdc80868ebf33ec703256abd0e6decf6a081565b6040519081526020015b60405180910390f35b6100a87fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c181565b61007f6100f0366004610757565b610352565b6101086101033660046106c0565b610365565b6040805194855260208501939093529183015260608201526080016100b2565b604080517fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c16020808301919091528183018a9052606082018990526080820188905260a08083018890528351808403909101815260c0830190935282519201919091207f190100000000000000000000000000000000000000000000000000000000000060e08301527fecad5adf2e2669f8deb31b6e606560fdc80868ebf33ec703256abd0e6decf6a060e283015261010282015260009061012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa15801561026d573d6000803e3d6000fd5b5050506020604051035190508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537465616c74684b657952656769737472793a20496e76616c6964205369676e60448201527f617475726500000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103468a8a8a8a8a6104b8565b50505050505050505050565b61035f33858585856104b8565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208181526040808320838052909152812054819081908190156103d95773ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320838052909152902054600294509250610410565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600184529091529020546003945092505b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600284529091529020541561047d57505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060028085529252909120546104b1565b505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060038085529252909120545b9193509193565b83600214806104c75750836003145b80156104dd575081600214806104dd5750816003145b610569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f537465616c74684b657952656769737472793a20496e76616c6964205072656660448201527f69780000000000000000000000000000000000000000000000000000000000006064820152608401610330565b60408051858152602081018590529081018390526060810182905273ffffffffffffffffffffffffffffffffffffffff8616907fe879dede910dd3b22239a11044df83c95adcd4b54003516f42866cc1fe4f0a199060800160405180910390a26105d4600285610789565b73ffffffffffffffffffffffffffffffffffffffff86166000908152602081905260408120919550610607866001610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff881681529182905281209061064a846005610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff979097168752868252808720958752949052838520929092558352912055565b803573ffffffffffffffffffffffffffffffffffffffff811681146106bb57600080fd5b919050565b6000602082840312156106d257600080fd5b6106db82610697565b9392505050565b600080600080600080600080610100898b0312156106ff57600080fd5b61070889610697565b97506020890135965060408901359550606089013594506080890135935060a089013560ff8116811461073a57600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806000806080858703121561076d57600080fd5b5050823594602084013594506040840135936060013592509050565b6000828210156107c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea264697066735822122019870f8b68c2a38dd8e08e0d8a59cc5dc5dff5338d8558eb989712ca985661e664736f6c63430008070033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.