Video Demo
What is happening here?
After the Players Connect their Wallet in the Main Menu, their Stacks principal is stored in a custom GI_Cryptonauts GameInstance so it persists through level loading.
Once the player enters the gameplay map, their local BP_PlayerController retrieves this principal from the GameInstance and sends it to the server using a Run-On-Server RPC (Server_Put_PS_Principal). The server then writes the value into a replicated variable on BP_PlayerState_Cryptonauts, ensuring that the authoritative identity is stored server-side and automatically synchronized to all clients.
This approach ensure that authentication data remains secure, cannot be spoofed by clients, persists across transitions, and is available everywhere in gameplay through the PlayerState replication system.
View this Transaction on the Hiro Explorer