Player BNS
First review the Player UI/UX and implement something like our Player Wallet Connect before proceeding
Cryptonauts leverages BNS for player identification. To learn more about BNS visit https://bns.one
Set Player Address
After the players have Connected their Stacks Wallet (Leather or Xverse) to your UE5 based game, you'll likely want to present their BNS Name (example: cryptodude.btc) on the MainMenu and else where.
To do this, after the Call Back is received, we will parse out and set the STX mainnet address as our MM_Principal (Main Menu Principal)

Casting to the Game Instance
Casting to the Game Instance is important for being able to facilitate Player Sent Transactions via your UE5 based game during map game play.
To make players principals actually discoverable and usable during the literal game play on your level/map.
You'll want to do Cast the variable to your own subclass of GameInstance.
Why? The base GameInstance that comes with Unreal has no variables or functions for storing auth data.
In this screenshot our MM_Principal is passed to our sub-class of GameInstance called GI_Cryptonauts
See Casting to Game Instance for details on how to pass the variable principal to the game level with server authority.
We introduced the Cast to GI_Cryptonauts and Set GI Principal nodes in our WB_MainMenu EventGraph just after we set our MM_Principal and checked for isSignedIn .
You can skip the circled nodes while you handle getting the Main Menu Stacks Authentication and BNS presentation up and working.
But, you will be required to do this or something similar, to get your player principal into the game map/level run time.

To retrieve and present the Player BNS Name on the Main Menu, you can wire that after our Cast to Set GI Principal node. OR Wire directly off the True on the Branch, then when ready to circle back to wiring in Casting to the Game Instance.
Get Player Name
Now that we have our players MM_Principal variable, will need to make use of it via BNSv2 API
GET https://api.bnsv2.com/names/address/{MM_Principal}/valid
Returns JSON of valid names owned by an address.
Example Get:
https://api.bnsv2.com/names/address/SP3WAR3N1XRR139DXCGPR1ATPK2VN63PGRXTD537N/valid
Example Response:
We want to call our API and extract the names[0].full_name from the response, and set it as variable MM_BNS, then use it in our WB_MainMenu to present to the player.
