The type of chain identifiers in SmartPy is sp.TChainId.
The corresponding type in Michelson is
Return a chain id of type sp.TChainId by its hexadecimal representation.
value = sp.chain_id_cst("0x9caecab9")
Check reference Chain Id template.
Please note that chain ids are non comparable. Equality can be verified by using sp.verify_equal.
Get the chain identifier of type sp.TChainId which represents the network currently evaluating the transaction.
@sp.entrypoint def ep(self): sp.verify(sp.chain_id == sp.chain_id_cst("0x9caecab9"))