Documentation
¶
Index ¶
- func ApproveMachinePathListCalldata(extensionID common.Hash, nonce uint64, messageHash common.Hash) ([]byte, error)
- func DecodeTeeAttestationRequest(attReq []byte) (verification.IVerificationTeeAttestation, error)
- func EncodeTeeAttestationRequest(req *verification.IVerificationTeeAttestation) (hexutil.Bytes, error)
- func GovernanceHash(signers []common.Address, threshold uint64) (common.Hash, error)
- func GovernanceHashSafe(teeManager, safe common.Address, owners []common.Address, threshold uint64) (common.Hash, error)
- func KeyExistenceDataHash(proof *wallet.IWalletKeyManagerKeyExistence) (common.Hash, error)
- func MachinePathListDataHash(extensionID common.Hash, nonce uint64, ...) (common.Hash, error)
- func ParsePaymentInstruction(data *instruction.DataFixed) (payments.ITeePaymentsPaymentInstructionMessage, error)
- func ParsePubKey(key PublicKey) (*ecdsa.PublicKey, error)
- func ParsePubKeyBytes(key []byte) (*ecdsa.PublicKey, error)
- func ParseVRFInstruction(data *instruction.DataFixed) (vrfstruct.IVrfVrfInstructionMessage, error)
- func PubKeyToBytes(key *ecdsa.PublicKey) []byte
- type Action
- type ActionData
- type ActionInfo
- type ActionResponse
- type ActionResult
- type ActionType
- type ConfigureChainIDRequest
- type ConfigureExtensionIDRequest
- type ConfigureGovernanceRequest
- type ConfigureInitialOwnerRequest
- type ConfigureProxyURLRequest
- type DecryptRequest
- type DecryptResponse
- type DirectInstruction
- type Governance
- type InitializePolicyRequest
- type KeyInfo
- type MachineData
- type MultiSignedPolicy
- type OpID
- type ProveRandomnessResponse
- type PublicKey
- type RewardingData
- type SetMachinePathListRequest
- type SignRequest
- type SignResponse
- type SignedKeyDirectBackup
- type SignedTeeInfoResponse
- type SubmissionTag
- type TeeInfo
- type TeeInfoRequest
- type TeeInfoResponse
- type TeeState
- type UpdatePolicyRequest
- type VoteSequence
- type XRPSignResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApproveMachinePathListCalldata ¶ added in v0.0.23
func ApproveMachinePathListCalldata( extensionID common.Hash, nonce uint64, messageHash common.Hash, ) ([]byte, error)
ApproveMachinePathListCalldata returns the calldata of MachinePathManagerFacet.approveMachinePathList(extensionId, nonce, messageHash) — the inner call a governance Safe makes to approve a finalized machine path list. Verifiers compare a Safe execTransaction's `data` against this expected value to bind the approval to the full list content (messageHash commits to the paths).
func DecodeTeeAttestationRequest ¶
func DecodeTeeAttestationRequest(attReq []byte) (verification.IVerificationTeeAttestation, error)
DecodeTeeAttestationRequest decodes the attestation request bytes into the strongly typed struct.
func EncodeTeeAttestationRequest ¶
func EncodeTeeAttestationRequest(req *verification.IVerificationTeeAttestation) (hexutil.Bytes, error)
EncodeTeeAttestationRequest serializes the attestation request using the generated struct ABI.
func GovernanceHash ¶ added in v0.0.21
GovernanceHash returns keccak256(abi.encode(address[], uint256)) for the given (signers, threshold) tuple — the same value the on-chain contract stores as `bytes32 governanceHash`.
func GovernanceHashSafe ¶ added in v0.0.23
func GovernanceHashSafe(teeManager, safe common.Address, owners []common.Address, threshold uint64) (common.Hash, error)
GovernanceHashSafe returns keccak256(abi.encode(teeManager, safe, owners, threshold)) — the governance hash the ExtensionGovernanceFacet stores for Safe-backed governance registered via setNewTeeGovernanceSafe. teeManager is the FlareTeeManager diamond address (address(this) in the facet) and owners and threshold are the Safe's owner set and threshold snapshotted at registration.
func KeyExistenceDataHash ¶ added in v0.0.21
func KeyExistenceDataHash(proof *wallet.IWalletKeyManagerKeyExistence) (common.Hash, error)
KeyExistenceDataHash returns keccak256(abi.encode(proof)), the inner dataHash WalletKeyManagerFacet.confirmKey wraps with SignedPayload.messageHash(TEE_KEY_EXISTENCE, ...). Callers wrap this value with signing.Payload{csigning.TEEKeyExistence, chainID, dataHash}.Hash() before signing or comparing.
func MachinePathListDataHash ¶ added in v0.0.21
func MachinePathListDataHash( extensionID common.Hash, nonce uint64, paths []machinepath.IMachinePathManagerMachinePath, ) (common.Hash, error)
MachinePathListDataHash returns keccak256(abi.encode(extensionId, nonce, paths)) — the inner dataHash MachinePathManagerFacet.finalize wraps with SignedPayload.messageHash(TEE_MACHINE_PATH_LIST, ...) to produce the on-chain pathList.messageHash. Callers wrap this value with signing.Payload{signing.TEEMachinePathList, chainID, dataHash} before signing or comparing against the on-chain messageHash. paths is encoded as tuple(address[] sourceTeeIds, address[] destinationTeeIds)[].
func ParsePaymentInstruction ¶
func ParsePaymentInstruction(data *instruction.DataFixed) (payments.ITeePaymentsPaymentInstructionMessage, error)
ParsePaymentInstruction decodes the payment instruction payload into the XRPL struct representation.
func ParsePubKey ¶
ParsePubKey converts the serialized public key into an ECDSA key.
func ParsePubKeyBytes ¶
ParsePubKeyBytes converts key that consists of concatenated X and Y coordinates into an ECDSA public key. Key is [X||Y] where X and Y are 32 bytes each.
func ParseVRFInstruction ¶
func ParseVRFInstruction(data *instruction.DataFixed) (vrfstruct.IVrfVrfInstructionMessage, error)
ParseVRFInstruction decodes the VRF instruction payload into the shared go-flare-common struct representation.
func PubKeyToBytes ¶
PubKeyToBytes returns the concatenated x and y coordinates of the key.
Types ¶
type ActionData ¶
type ActionData struct {
ID common.Hash `json:"id"`
Type ActionType `json:"type"`
SubmissionTag SubmissionTag `json:"submissionTag"`
Message hexutil.Bytes `json:"message"`
}
type ActionInfo ¶
type ActionInfo struct {
QueueID string `json:"queueId"`
ActionID common.Hash `json:"actionId"`
SubmissionTag SubmissionTag `json:"submissionTag"`
}
type ActionResponse ¶
type ActionResponse struct {
Result ActionResult `json:"result"`
Signature hexutil.Bytes `json:"signature"`
ProxySignature hexutil.Bytes `json:"proxySignature"`
}
type ActionResult ¶
type ActionResult struct {
ID common.Hash `json:"id"`
SubmissionTag SubmissionTag `json:"submissionTag"`
Status uint8 `json:"status"`
Log string `json:"log"`
OPType common.Hash `json:"opType"`
OPCommand common.Hash `json:"opCommand"`
AdditionalResultStatus hexutil.Bytes `json:"additionalResultStatus"`
Version string `json:"version"`
Data hexutil.Bytes `json:"data"`
}
The response received after queuing an action
func (*ActionResult) Hash ¶ added in v0.0.20
func (ar *ActionResult) Hash() []byte
Hash returns keccak256(keccak256(data) || id || keccak256(submissionTag) || status).
type ActionType ¶
type ActionType string
const ( Instruction ActionType = "instruction" Direct ActionType = "direct" )
type ConfigureChainIDRequest ¶ added in v0.0.21
type ConfigureChainIDRequest struct {
ChainID *uint64 `json:"chainId"`
}
type ConfigureGovernanceRequest ¶ added in v0.0.21
type ConfigureGovernanceRequest struct {
Signers *[]common.Address `json:"signers"`
Threshold *uint64 `json:"threshold"`
// Safe and TeeManager configure Safe-backed governance; both must be set
// together, and omitting them configures plain governance.
Safe *common.Address `json:"safe,omitempty"`
TeeManager *common.Address `json:"teeManager,omitempty"`
}
type ConfigureProxyURLRequest ¶
type ConfigureProxyURLRequest struct {
URL *string `json:"url"` // The pointer ensures {} and {"url": ""} unmarshal distinctly.
}
type DecryptRequest ¶
type DecryptRequest struct {
EncryptedMessage []byte `json:"encryptedMessage"`
}
type DecryptResponse ¶
type DecryptResponse struct {
DecryptedMessage []byte `json:"decryptedMessage"`
}
type DirectInstruction ¶
type Governance ¶ added in v0.0.21
type Governance struct {
Signers []common.Address `json:"signers"`
Threshold uint64 `json:"threshold"`
Hash common.Hash `json:"hash"`
Safe common.Address `json:"safe"`
TeeManager common.Address `json:"teeManager"`
}
Governance is the governance signer-set known to the node. Two flavors exist, discriminated by Safe:
- plain: Hash is keccak256(abi.encode(Signers, Threshold)) and Safe is the zero address;
- Safe-backed: Signers/Threshold are the snapshot of the Safe multisig's owners and threshold recorded on-chain at registration, and Hash is keccak256(abi.encode(TeeManager, Safe, Signers, Threshold)).
Both match the value stored on-chain as governanceHash.
type InitializePolicyRequest ¶
type KeyInfo ¶ added in v0.0.20
type KeyInfo struct {
WalletID common.Hash `json:"walletId"`
KeyID uint64 `json:"keyId"`
Nonce uint64 `json:"nonce"`
}
KeyInfo identifies a wallet key together with its current replay-protection nonce.
type MachineData ¶
type MachineData struct {
ExtensionID common.Hash `json:"extensionId"`
InitialOwner common.Address `json:"initialOwner"`
CodeHash common.Hash `json:"codeHash"`
Platform common.Hash `json:"platform"`
PublicKey PublicKey `json:"publicKey"`
GovernanceHash common.Hash `json:"governanceHash"`
}
func (*MachineData) DataHash ¶ added in v0.0.21
func (md *MachineData) DataHash() (common.Hash, error)
DataHash returns keccak256(abi.encode(teeMachineData)) — the inner dataHash MachineManagerFacet.register wraps with SignedPayload.messageHash(TEE_MACHINE_REGISTER, ...). Callers wrap this value with signing.Payload{TeeMachineRegisterTag, chainID, dataHash}.Hash() before signing or comparing.
type MultiSignedPolicy ¶
type ProveRandomnessResponse ¶
type PublicKey ¶
func PubKeyToStruct ¶
PubKeyToStruct converts an ECDSA public key into the fixed-size struct form.
type RewardingData ¶
type SetMachinePathListRequest ¶ added in v0.0.21
type SetMachinePathListRequest struct {
Paths []machinepath.IMachinePathManagerMachinePath
Nonce uint64
Signatures [][]byte
SafeApproval *safe.Approval `json:",omitempty"`
}
SetMachinePathListRequest is the JSON payload of a SET_MACHINE_PATH_LIST direct instruction: the active list of authorized machine paths, its monotonic nonce, and the governance authorization for it. A path authorizes any (source, destination) pair where source is in SourceTeeIds and destination is in DestinationTeeIds.
Two authorization forms exist and either satisfies the node:
- Signatures: direct governance-signer ECDSA signatures over signing.Payload{signing.TEEMachinePathList, chainID, MachinePathListDataHash(...)} (collected from signMachinePathList transactions);
- SafeApproval: for a single approveMachinePathList call by the governance Safe (Safe-backed governance only), the execTransaction parameter set (owners' signatures blob included) and the Safe nonce it executed at. The node reconstructs the Safe transaction hash at that nonce and re-verifies the owner signatures itself.
type SignRequest ¶
type SignRequest struct {
Message []byte `json:"message"`
}
type SignResponse ¶
type SignedKeyDirectBackup ¶ added in v0.0.21
type SignedKeyDirectBackup struct {
Payload hexutil.Bytes `json:"payload"`
TEESignature hexutil.Bytes `json:"teeSignature"`
}
SignedKeyDirectBackup is the envelope produced by KEY_DIRECT_BACKUP. Payload is a JSON-encoded KeyDirectBackupPayload; TEESignature is the source TEE's signature over signing.Payload{TEEKeyDirectBackupTag, chainID, keccak256(Payload)}.Hash().
type SignedTeeInfoResponse ¶
type SignedTeeInfoResponse struct {
TeeInfoResponse
ProxySignature hexutil.Bytes `json:"proxySignature"`
}
type SubmissionTag ¶
type SubmissionTag string
const ( // Submission tags for instruction action Threshold SubmissionTag = "threshold" End SubmissionTag = "end" Submit SubmissionTag = "submit" )
type TeeInfo ¶
type TeeInfo struct {
Challenge common.Hash `json:"challenge"`
PublicKey PublicKey `json:"publicKey"`
InitialSigningPolicyID uint32 `json:"initialSigningPolicyId"`
InitialSigningPolicyHash common.Hash `json:"initialSigningPolicyHash"`
LastSigningPolicyID uint32 `json:"lastSigningPolicyId"`
LastSigningPolicyHash common.Hash `json:"lastSigningPolicyHash"`
ChainID uint64 `json:"chainId"`
State TeeState `json:"state"`
TeeTimestamp uint64 `json:"teeTimestamp"`
MachinePathListNonce uint64 `json:"machinePathListNonce"`
MachinePathListHash common.Hash `json:"machinePathListHash"`
}
type TeeInfoRequest ¶
type TeeInfoResponse ¶
type TeeInfoResponse struct {
TeeInfo TeeInfo `json:"teeInfo"`
MachineData MachineData `json:"machineData"`
DataSignature hexutil.Bytes `json:"dataSignature"`
Attestation string `json:"attestation"`
}
type UpdatePolicyRequest ¶
type UpdatePolicyRequest struct {
NewPolicy MultiSignedPolicy
PublicKeys []PublicKey
}
type VoteSequence ¶
type VoteSequence struct {
VoteHash common.Hash `json:"voteHash"`
InstructionID common.Hash `json:"instructionId"`
InstructionHash common.Hash `json:"instructionHash"`
RewardEpochID uint32 `json:"rewardEpochId"`
TeeID common.Address `json:"teeId"`
Signatures []hexutil.Bytes `json:"signatures"` // Signatures of the signers and cosigners
AdditionalVariableMessageHashes []common.Hash `json:"additionalVariableMessageHashes"`
Timestamps []uint64 `json:"timestamps"`
}