Initialise provider and connect wallet with Passport
Learn how to initialise the zkEVM provider and connect the user's wallet in your Unreal game.
Overview
After users have successfully logged into Passport, you need to initialise the zkEVM provider and connect their wallet to enable blockchain functionality. This involves two main steps:
- ConnectEvm - Initialises the zkEVM provider
- ZkEvmRequestAccounts - Creates/connects the user's wallet and retrieves their wallet address
Implementation
In order to interact with Immutable zkEVM, you will need to instantiate the Passport's zkEVM provider via ConnectEvm
. Then, ZkEvmRequestAccounts
blueprint node must be called to initialise the gamer's wallet and retrieve their wallet address.
The player will not have a wallet until the ZkEvmRequestAccounts
function is called. Developers should call this function if they want to create a wallet for the player after logging into Passport.
For more details on authenticating users without a wallet, see the Authenticating users without wallet section.
ZkEvmRequestAccounts
is a resource-intensive function. To ensure optimal gaming experience and performance, it is recommended to call this function separately or asynchronously from the login process. For example, call Login
to log users into the game and let them start playing:- In the background, call
ConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address. - Or later, when users need to use their wallet, call
ConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address.
PKCE
- BlueprintUE
- Image

The player will not have a wallet until the ZkEvmRequestAccounts
function is called. Developers should call this function if they want to create a wallet for the player after logging into Passport.
For more details on authenticating users without a wallet, see the Authenticating users without wallet section.
ZkEvmRequestAccounts
is a resource-intensive function. To ensure optimal gaming experience and performance, it is recommended to call this function separately or asynchronously from the login process. For example, call Login
to log users into the game and let them start playing:- In the background, call
ConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address. - Or later, when users need to use their wallet, call
ConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address.
Important Considerations
ZkEvmRequestAccounts
is a resource-intensive function. To ensure optimal gaming experience and performance, it is recommended to call this function separately or asynchronously from the login process.Recommended Approaches
Background Initialisation: Call
Login
to log users into the game and let them start playing. In the background, callConnectEvm
andZkEvmRequestAccounts
functions to initialise their wallet and get their address.On-Demand Initialisation: Call
ConnectEvm
andZkEvmRequestAccounts
functions later when users need to use their wallet for specific features.
When is a Wallet Created?
ZkEvmRequestAccounts
function is called. Developers should call this function if they want to create a wallet for the player after logging into Passport.For more details on authenticating users without a wallet, see the Authenticating users without wallet section.
Next Steps
Once you've initialised the provider and wallet, you can:
- Send transactions to interact with smart contracts
- Sign typed data for message verification