Latest 25 from a total of 11,293 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Stealth Keys | 23754882 | 1 min ago | IN | 0 ETH | 0.00016534 | ||||
| Set Stealth Keys | 23745774 | 30 hrs ago | IN | 0 ETH | 0.00014768 | ||||
| Set Stealth Keys | 23744715 | 34 hrs ago | IN | 0 ETH | 0.00002685 | ||||
| Set Stealth Keys | 23736628 | 2 days ago | IN | 0 ETH | 0.00009764 | ||||
| Set Stealth Keys | 23715516 | 5 days ago | IN | 0 ETH | 0.00000815 | ||||
| Set Stealth Keys | 23715419 | 5 days ago | IN | 0 ETH | 0.00004391 | ||||
| Set Stealth Keys | 23708173 | 6 days ago | IN | 0 ETH | 0.00007278 | ||||
| Set Stealth Keys | 23702198 | 7 days ago | IN | 0 ETH | 0.00015462 | ||||
| Set Stealth Keys | 23695617 | 8 days ago | IN | 0 ETH | 0.00001004 | ||||
| Set Stealth Keys | 23688647 | 9 days ago | IN | 0 ETH | 0.00000678 | ||||
| Set Stealth Keys | 23688643 | 9 days ago | IN | 0 ETH | 0.00001475 | ||||
| Set Stealth Keys | 23682473 | 10 days ago | IN | 0 ETH | 0.00017251 | ||||
| Set Stealth Keys | 23682469 | 10 days ago | IN | 0 ETH | 0.00016964 | ||||
| Set Stealth Keys | 23677950 | 10 days ago | IN | 0 ETH | 0.00016131 | ||||
| Set Stealth Keys | 23677913 | 10 days ago | IN | 0 ETH | 0.00015929 | ||||
| Set Stealth Keys | 23666369 | 12 days ago | IN | 0 ETH | 0.00001749 | ||||
| Set Stealth Keys | 23655033 | 13 days ago | IN | 0 ETH | 0.00000725 | ||||
| Set Stealth Keys | 23639509 | 16 days ago | IN | 0 ETH | 0.00004525 | ||||
| Set Stealth Keys | 23639048 | 16 days ago | IN | 0 ETH | 0.00015605 | ||||
| Set Stealth Keys | 23639012 | 16 days ago | IN | 0 ETH | 0.00015666 | ||||
| Set Stealth Keys | 23634491 | 16 days ago | IN | 0 ETH | 0.00002078 | ||||
| Set Stealth Keys | 23629790 | 17 days ago | IN | 0 ETH | 0.00000768 | ||||
| Set Stealth Keys | 23619350 | 18 days ago | IN | 0 ETH | 0.00005167 | ||||
| Set Stealth Keys | 23619231 | 18 days ago | IN | 0 ETH | 0.00003212 | ||||
| Set Stealth Keys | 23605440 | 20 days ago | IN | 0 ETH | 0.00000865 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
StealthKeyRegistry
Compiler Version
v0.8.7+commit.e28d00a7
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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);
}
}{
"optimizer": {
"enabled": true,
"runs": 999999
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
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"}]Contract Creation Code
60a060405234801561001057600080fd5b50604080518082018252601a81527f556d62726120537465616c7468204b65792052656769737472790000000000006020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f918101919091527f4baf469995623d4e8baaebc31ddb114fbc90e91c717e133da2fb936309b41eb9918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160408051601f1981840301815291905280516020909101206080526080516107fd61011c60003960008181608601526101b301526107fd6000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806367eaa7ac1161005057806367eaa7ac146100bb578063bb8f257b146100e2578063cec2a787146100f557600080fd5b8063100dcc531461006c5780633644e51514610081575b600080fd5b61007f61007a3660046106e2565b610128565b005b6100a87f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100a87fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c181565b61007f6100f0366004610757565b610352565b6101086101033660046106c0565b610365565b6040805194855260208501939093529183015260608201526080016100b2565b604080517fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c16020808301919091528183018a9052606082018990526080820188905260a08083018890528351808403909101815260c0830190935282519201919091207f190100000000000000000000000000000000000000000000000000000000000060e08301527f000000000000000000000000000000000000000000000000000000000000000060e283015261010282015260009061012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa15801561026d573d6000803e3d6000fd5b5050506020604051035190508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537465616c74684b657952656769737472793a20496e76616c6964205369676e60448201527f617475726500000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103468a8a8a8a8a6104b8565b50505050505050505050565b61035f33858585856104b8565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208181526040808320838052909152812054819081908190156103d95773ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320838052909152902054600294509250610410565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600184529091529020546003945092505b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600284529091529020541561047d57505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060028085529252909120546104b1565b505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060038085529252909120545b9193509193565b83600214806104c75750836003145b80156104dd575081600214806104dd5750816003145b610569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f537465616c74684b657952656769737472793a20496e76616c6964205072656660448201527f69780000000000000000000000000000000000000000000000000000000000006064820152608401610330565b60408051858152602081018590529081018390526060810182905273ffffffffffffffffffffffffffffffffffffffff8616907fe879dede910dd3b22239a11044df83c95adcd4b54003516f42866cc1fe4f0a199060800160405180910390a26105d4600285610789565b73ffffffffffffffffffffffffffffffffffffffff86166000908152602081905260408120919550610607866001610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff881681529182905281209061064a846005610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff979097168752868252808720958752949052838520929092558352912055565b803573ffffffffffffffffffffffffffffffffffffffff811681146106bb57600080fd5b919050565b6000602082840312156106d257600080fd5b6106db82610697565b9392505050565b600080600080600080600080610100898b0312156106ff57600080fd5b61070889610697565b97506020890135965060408901359550606089013594506080890135935060a089013560ff8116811461073a57600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806000806080858703121561076d57600080fd5b5050823594602084013594506040840135936060013592509050565b6000828210156107c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea264697066735822122019870f8b68c2a38dd8e08e0d8a59cc5dc5dff5338d8558eb989712ca985661e664736f6c63430008070033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c806367eaa7ac1161005057806367eaa7ac146100bb578063bb8f257b146100e2578063cec2a787146100f557600080fd5b8063100dcc531461006c5780633644e51514610081575b600080fd5b61007f61007a3660046106e2565b610128565b005b6100a87fbffc56f4d2a2d2f02a0a5fd845c389cb145f77af539d336fc9ec35063764219481565b6040519081526020015b60405180910390f35b6100a87fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c181565b61007f6100f0366004610757565b610352565b6101086101033660046106c0565b610365565b6040805194855260208501939093529183015260608201526080016100b2565b604080517fab73c83a21fb894c20095a8f28177984b02f6284c760e4c1ac2f82c3d34b79c16020808301919091528183018a9052606082018990526080820188905260a08083018890528351808403909101815260c0830190935282519201919091207f190100000000000000000000000000000000000000000000000000000000000060e08301527fbffc56f4d2a2d2f02a0a5fd845c389cb145f77af539d336fc9ec35063764219460e283015261010282015260009061012201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa15801561026d573d6000803e3d6000fd5b5050506020604051035190508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610339576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f537465616c74684b657952656769737472793a20496e76616c6964205369676e60448201527f617475726500000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103468a8a8a8a8a6104b8565b50505050505050505050565b61035f33858585856104b8565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208181526040808320838052909152812054819081908190156103d95773ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320838052909152902054600294509250610410565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600184529091529020546003945092505b73ffffffffffffffffffffffffffffffffffffffff8516600090815260208181526040808320600284529091529020541561047d57505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060028085529252909120546104b1565b505073ffffffffffffffffffffffffffffffffffffffff831660009081526020818152604080832060038085529252909120545b9193509193565b83600214806104c75750836003145b80156104dd575081600214806104dd5750816003145b610569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f537465616c74684b657952656769737472793a20496e76616c6964205072656660448201527f69780000000000000000000000000000000000000000000000000000000000006064820152608401610330565b60408051858152602081018590529081018390526060810182905273ffffffffffffffffffffffffffffffffffffffff8616907fe879dede910dd3b22239a11044df83c95adcd4b54003516f42866cc1fe4f0a199060800160405180910390a26105d4600285610789565b73ffffffffffffffffffffffffffffffffffffffff86166000908152602081905260408120919550610607866001610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff881681529182905281209061064a846005610789565b81526020808201929092526040908101600090812081905573ffffffffffffffffffffffffffffffffffffffff979097168752868252808720958752949052838520929092558352912055565b803573ffffffffffffffffffffffffffffffffffffffff811681146106bb57600080fd5b919050565b6000602082840312156106d257600080fd5b6106db82610697565b9392505050565b600080600080600080600080610100898b0312156106ff57600080fd5b61070889610697565b97506020890135965060408901359550606089013594506080890135935060a089013560ff8116811461073a57600080fd5b979a969950949793969295929450505060c08201359160e0013590565b6000806000806080858703121561076d57600080fd5b5050823594602084013594506040840135936060013592509050565b6000828210156107c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50039056fea264697066735822122019870f8b68c2a38dd8e08e0d8a59cc5dc5dff5338d8558eb989712ca985661e664736f6c63430008070033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ETH | 100.00% | $0.999802 | 960.8177 | $960.63 |
Loading...
Loading
Loading...
Loading
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.