Documentation ¶
Index ¶
- Constants
- func ChainOperatorKeys(chainID *big.Int) func(ChainOperatorRole) ChainOperatorKey
- func ChainUserKeys(chainID *big.Int) func(index uint64) ChainUserKey
- func SuperchainOperatorKeys(chainID *big.Int) func(role SuperchainOperatorRole) SuperchainOperatorKey
- type Addresses
- type ChainOperatorKey
- type ChainOperatorRole
- type ChainUserKey
- type Key
- type Keys
- type MnemonicDevKeys
- type Role
- type Secrets
- type SuperchainOperatorKey
- type SuperchainOperatorRole
- type UserKey
Constants ¶
const TestMnemonic = "test test test test test test test test test test test junk"
Variables ¶
This section is empty.
Functions ¶
func ChainOperatorKeys ¶
func ChainOperatorKeys(chainID *big.Int) func(ChainOperatorRole) ChainOperatorKey
ChainOperatorKeys is a helper method to not repeat chainID on every operator role
func ChainUserKeys ¶
func ChainUserKeys(chainID *big.Int) func(index uint64) ChainUserKey
ChainUserKeys is a helper method to not repeat chainID for every user key
func SuperchainOperatorKeys ¶
func SuperchainOperatorKeys(chainID *big.Int) func(role SuperchainOperatorRole) SuperchainOperatorKey
SuperchainOperatorKeys is a helper method to not repeat chainID on every operator role
Types ¶
type Addresses ¶
type Addresses interface { // Address produces an address for the given key Address(key Key) (common.Address, error) }
Addresses selects an address based on a key. This interface is preferred in tools that do not directly rely on secret-key material.
type ChainOperatorKey ¶
type ChainOperatorKey struct { ChainID *big.Int Role ChainOperatorRole }
ChainOperatorKey is an account specific to an OperationRole of a given OP-Stack chain.
func (ChainOperatorKey) HDPath ¶
func (k ChainOperatorKey) HDPath() string
func (ChainOperatorKey) String ¶
func (k ChainOperatorKey) String() string
type ChainOperatorRole ¶
type ChainOperatorRole uint64
ChainOperatorRole identifies an account for a specific OP-Stack chain operator role.
const ( // DeployerRole is the deployer of contracts for an OP-Stack chain DeployerRole ChainOperatorRole = 0 // ProposerRole is the key used by op-proposer ProposerRole ChainOperatorRole = 1 // BatcherRole is the key used by op-batcher BatcherRole ChainOperatorRole = 2 // SequencerP2PRole is the key used to publish sequenced L2 blocks SequencerP2PRole ChainOperatorRole = 3 // ChallengerRole is the key used by op-challenger ChallengerRole ChainOperatorRole = 4 // L2ProxyAdminOwnerRole is the key that controls the ProxyAdmin predeploy in L2 L2ProxyAdminOwnerRole ChainOperatorRole = 5 // L1ProxyAdminOwnerRole is the key that owns the ProxyAdmin on the L1 side of the deployment. // This can be the ProxyAdmin of a L2 chain deployment, or a superchain deployment, depending on the domain. L1ProxyAdminOwnerRole ChainOperatorRole = 6 // BaseFeeVaultRecipientRole is the key that receives from the BaseFeeVault predeploy BaseFeeVaultRecipientRole ChainOperatorRole = 7 // L1FeeVaultRecipientRole is the key that receives from the L1FeeVault predeploy L1FeeVaultRecipientRole ChainOperatorRole = 8 // SequencerFeeVaultRecipientRole is the key that receives form the SequencerFeeVault predeploy SequencerFeeVaultRecipientRole ChainOperatorRole = 9 // SystemConfigOwner is the key that can make SystemConfig changes. SystemConfigOwner ChainOperatorRole = 10 )
func (*ChainOperatorRole) MarshalText ¶ added in v1.9.5
func (role *ChainOperatorRole) MarshalText() ([]byte, error)
func (ChainOperatorRole) String ¶
func (role ChainOperatorRole) String() string
func (*ChainOperatorRole) UnmarshalText ¶ added in v1.9.5
func (role *ChainOperatorRole) UnmarshalText(data []byte) error
type ChainUserKey ¶
ChainUserKey is a user-key, but purpose-specific to a single chain. ChainID == 0 results in deriving the same key as a regular UserKey for any chain.
func (ChainUserKey) HDPath ¶
func (k ChainUserKey) HDPath() string
func (ChainUserKey) String ¶
func (k ChainUserKey) String() string
type Key ¶
type Key interface { // HDPath produces the hierarchical derivation path to (re)create this key. HDPath() string // String describes the role of the key String() string }
Key identifies an account, and produces an HD-Path to derive the secret-key from.
We organize the dev keys with a mnemonic key-path structure as following: BIP-44: `m / purpose' / coin_type' / account' / change / address_index` purpose = standard secp256k1 usage (Eth2 BLS keys use different purpose data). coin_type = chain type, set to 60' for ETH. See SLIP-0044. account = for different identities, used here to separate domains:
domain 0: users domain 1: superchain operations domain 2: chain operations
change = to separate external and internal addresses.
Used here for chain ID, may be 0 for user accounts (any-chain addresses).
address_index = used here to separate roles. The `'` char signifies BIP-32 hardened derivation.
See: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki https://github.com/satoshilabs/slips/blob/master/slip-0044.md https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
type MnemonicDevKeys ¶
type MnemonicDevKeys struct {
// contains filtered or unexported fields
}
func NewMnemonicDevKeys ¶
func NewMnemonicDevKeys(mnemonic string) (*MnemonicDevKeys, error)
func (*MnemonicDevKeys) Address ¶
func (d *MnemonicDevKeys) Address(key Key) (common.Address, error)
func (*MnemonicDevKeys) Secret ¶
func (d *MnemonicDevKeys) Secret(key Key) (*ecdsa.PrivateKey, error)
type Secrets ¶
type Secrets interface {
Secret(key Key) (*ecdsa.PrivateKey, error)
}
Secrets selects a secret-key based on a key. This is meant for dev-purposes only. Secret keys should not directly be exposed to live production services.
type SuperchainOperatorKey ¶
type SuperchainOperatorKey struct { ChainID *big.Int Role SuperchainOperatorRole }
SuperchainOperatorKey is an account specific to an OperationRole of a given OP-Stack chain.
func (SuperchainOperatorKey) HDPath ¶
func (k SuperchainOperatorKey) HDPath() string
func (SuperchainOperatorKey) String ¶
func (k SuperchainOperatorKey) String() string
type SuperchainOperatorRole ¶
type SuperchainOperatorRole uint64
SuperchainOperatorRole identifies an account used in the operations of superchain contracts
const ( // SuperchainDeployerKey is the deployer of the superchain contracts. SuperchainDeployerKey SuperchainOperatorRole = 0 // SuperchainProxyAdminOwner is the key that owns the superchain ProxyAdmin SuperchainProxyAdminOwner SuperchainOperatorRole = 1 // SuperchainConfigGuardianKey is the Guardian of the SuperchainConfig. SuperchainConfigGuardianKey SuperchainOperatorRole = 2 // SuperchainProtocolVersionsOwner is the key that can make ProtocolVersions changes. SuperchainProtocolVersionsOwner SuperchainOperatorRole = 3 // DependencySetManagerKey is the key used to manage the dependency set of a superchain. DependencySetManagerKey SuperchainOperatorRole = 4 )
func (SuperchainOperatorRole) Key ¶ added in v1.9.3
func (role SuperchainOperatorRole) Key(chainID *big.Int) Key
func (*SuperchainOperatorRole) MarshalText ¶ added in v1.9.5
func (role *SuperchainOperatorRole) MarshalText() ([]byte, error)
func (SuperchainOperatorRole) String ¶
func (role SuperchainOperatorRole) String() string
func (*SuperchainOperatorRole) UnmarshalText ¶ added in v1.9.5
func (role *SuperchainOperatorRole) UnmarshalText(data []byte) error