Add Algorand wallet auth and transaction signing to your Unity game. Open-source, free, built for Unity 6+.
| Wallet | How it works |
|---|---|
| Pera | QR code scan (WalletConnect v1). On WebGL the SDK uses Pera's official @perawallet/connect; mobile browsers get an "Open in wallet app" deep link |
| Defly | QR code scan (WalletConnect v2), mobile deep link per Defly's official SDK |
| X-Chain (beta) | Any EVM wallet via xChain Accounts. On WebGL the SDK discovers every wallet installed in the player's browser (EIP-6963) and shows it in the picker with its real icon — MetaMask, Rainbow, Coinbase Wallet, Trust + more; native builds connect via WalletConnect QR. Off by default — set enableEvmXChain in your BlockmakerConfig |
| Server-managed OTP out of the box (all platforms); optionally Magic SDK on WebGL with your own key |
Currently Algorand mainnet only.
- Download BlockmakerInstaller.cs (right-click → Save As)
- Drag it into your Unity project (anywhere in the Assets folder)
- A dialog will appear — click Install
- Unity installs everything automatically. Done.
You can delete the installer file after installation.
Manual install (if you prefer)
Open Packages/manifest.json in your project folder and add:
In "dependencies":
"com.blockmaker.sdk": "https://github.com/blockmaker-ai/blockmaker-unity.git#v1.2.0",
"com.nethereum.unity": "4.19.2",
"com.reown.sign.nethereum": "1.6.0",
"com.reown.sign.unity": "1.6.0",At the bottom of the file, before the last }:
,
"scopedRegistries": [
{
"name": "OpenUPM",
"url": "https://package.openupm.com",
"scopes": ["com.reown", "com.nethereum", "com.cysharp"]
}
]Save and reopen Unity.
Go to Blockmaker > Setup Scene in the menu bar. This automatically:
- Creates a BlockmakerConfig asset
- Adds BlockmakerAuth with the config wired up
- Adds the auth UI with all UXML assets pre-assigned
- Creates PanelSettings if needed
- Adds a Connect Wallet button
Hit Play — the wallet system is ready. No API keys or signups needed.
Want to see it working first? In Package Manager > Blockmaker SDK > Samples, import the Wallet Demo. Add the WalletDemo script to an empty GameObject and hit Play — includes wallet connection and transaction signing.
using Blockmaker;
// Pera (QR code)
BlockmakerAuth.Instance.ConnectWallet("Pera",
identity => Debug.Log($"Connected: {identity.Address}"),
error => Debug.Log(error)
);
// Defly (QR code)
BlockmakerAuth.Instance.ConnectWallet("Defly",
identity => Debug.Log($"Connected: {identity.Address}"),
error => Debug.Log(error)
);
// X-Chain — any EVM wallet (beta). On WebGL this auto-picks the player's
// last-used browser wallet; native builds show a WalletConnect QR.
// Off by default — set enableEvmXChain in your BlockmakerConfig.
BlockmakerAuth.Instance.ConnectEvm(
identity => Debug.Log($"Connected: {identity.Address}"), // Algorand address, derived from the EVM key
error => Debug.Log(error)
);
// Email login — built-in server OTP (works everywhere, no keys needed)
BlockmakerAuth.Instance.RequestEmailOTP("player@example.com",
() => Debug.Log("Code sent — check your inbox"),
error => Debug.Log(error)
);
BlockmakerAuth.Instance.VerifyEmailOTP("player@example.com", "123456",
identity => Debug.Log($"Signed in: {identity.Address}"),
error => Debug.Log(error)
);
// Email login via Magic SDK — WebGL only, requires magicPublishableKey in your config
// (without a key the built-in auth UI automatically uses the OTP flow above)
BlockmakerAuth.Instance.ConnectMagicEmail("player@example.com",
identity => Debug.Log($"Signed in: {identity.Address}"),
error => Debug.Log(error)
);var identity = await BlockmakerAuth.Instance.ConnectWalletAsync("Pera");
var evmIdentity = await BlockmakerAuth.Instance.ConnectEvmAsync();var identity = BlockmakerAuth.Instance.Identity;
// Single transaction
yield return identity.SignTransaction(unsignedTxnBase64,
signed => Debug.Log("Signed!"),
error => Debug.Log(error)
);
// Atomic group
yield return identity.SignTransactions(unsignedTxnsBase64,
signed => Debug.Log($"Signed {signed.Length} transactions"),
error => Debug.Log(error)
);BlockmakerAuth.Instance.HasWallet // true if a wallet is connected
BlockmakerAuth.Instance.Address // Algorand address
BlockmakerAuth.Instance.CanSign // true if the wallet can sign right now
BlockmakerAuth.Instance.IsLoggedIn // true for Email or SelfCustody tier
BlockmakerAuth.Instance.Tier // Guest, Email, or SelfCustodyvoid OnEnable()
{
BlockmakerAuth.OnIdentityChanged += HandleIdentityChanged;
}
void OnDisable()
{
BlockmakerAuth.OnIdentityChanged -= HandleIdentityChanged;
}
void HandleIdentityChanged(IBlockmakerIdentity identity)
{
Debug.Log($"Identity changed: {identity.ProviderName} — {identity.Address}");
}Self-custody sign-in is two approvals: connect, then a signature that logs the player into the backend. The SDK exposes everything a custom UI needs to render that honestly:
// Boot-time restore: don't guess — wait for the restore to settle.
if (BlockmakerAuth.SessionRestoreSettled) { /* auth state is known */ }
BlockmakerAuth.OnSessionRestoreSettled += () =>
Debug.Log($"Restore settled — tier: {BlockmakerAuth.Instance.Tier}");
// Progress messages while the player must act in their wallet app.
BlockmakerAuth.OnAuthStatus += msg => statusLabel.text = msg;
// The step-2 (login signature) window: offer RESEND / CANCEL instead of a dead end.
if (BlockmakerAuth.CanRetryWalletLogin)
{
BlockmakerAuth.Instance.RetryWalletLogin(); // push a fresh sign-in request
// or: BlockmakerAuth.Instance.CancelWalletLogin();
}
// Skip best-effort backend calls that would 401 for guests.
if (BlockmakerClient.Instance.HasBackendSession) { /* safe to call player APIs */ }The built-in auth UI already implements all of this (a "STEP 2 OF 2" panel with RESEND / CANCEL).
On WebGL the SDK loads its wallet libraries from jsDelivr at runtime — zero setup.
For immunity to ad-blockers and CDN outages you can ship the bundles with your game:
build IIFE bundles that assign window.BmPeraVendor = { PeraWalletConnect, algosdk }
and/or window.BmWCVendor = { SignClient, QRCode }, and load them via <script> tags
before the Unity loader (e.g. from your WebGL template's TemplateData/). The SDK
uses them automatically and only falls back to the CDN when they're absent.
If you distribute such bundles, retain the upstream license notices (MIT for
@perawallet/connect, algosdk and qrcode; Apache-2.0 — including its NOTICE terms —
for @walletconnect/sign-client).
BlockmakerAuth.Instance.Logout();The SDK includes ready-to-use UI screens built with UI Toolkit:
- Auth screen — wallet picker, QR display, email OTP flow
- Wallet bar — shows connected address, tier badge
- QR modal — Pera/Defly/X-Chain connection with copy-link fallback
- Wallet upgrade prompt — nudges guests to connect
All UI is optional — you can build your own using the BlockmakerAuth API directly.
The built-in auth prompt includes a wallet picker — one flat list, no extra setup:
- Pera and Defly always on top (QR connect, mobile deep links)
- EVM wallets (when
enableEvmXChainis on): on WebGL every wallet installed in the player's browser appears automatically with its real icon (EIP-6963 discovery); on native builds a curated set (MetaMask, Rainbow, Coinbase Wallet, Trust) connects by WalletConnect QR - Honest per-wallet states — connecting, declined-in-wallet, request-already-pending, each with retry/back; a "Find one" link when no browser wallet is installed
Building your own picker instead? Two calls drive it:
// List installed browser wallets (WebGL). Returns raw JSON:
// {"wallets":[{"rdns":"io.metamask","name":"MetaMask","icon":"<base64 PNG>","lastUsed":true}],"legacy":true}
// — or "!none" when no EVM wallet is installed. On native platforms it returns
// {"wallets":[],"legacy":false,"native":true}: skip the picker and call ConnectEvm().
BlockmakerAuth.Instance.DiscoverEvmWallets(json => BuildMyPicker(json));
// Connect the wallet the player picked (rdns from discovery; "" = auto-pick).
BlockmakerAuth.Instance.ConnectEvmWallet("io.metamask",
identity => Debug.Log($"Connected: {identity.Address}"),
error => Debug.Log(error) // "code|message", e.g. "4001|User rejected the request."
);SDK logs are silent in release builds by default. To adjust:
// Show all SDK logs (useful for debugging)
BlockmakerLog.Level = BlockmakerLogLevel.Verbose;
// Intercept logs for your own system
BlockmakerLog.OnLog += (level, msg) => MyLogger.Log(msg);All fields are optional — the SDK works with defaults out of the box.
| Field | Description |
|---|---|
serverUrl |
Your own Blockmaker server URL. Leave empty to use the shared default |
apiKey |
Your own API key (sk_ prefix). Only used in the Unity Editor, never shipped in player builds |
walletConnectProjectId |
Your own WalletConnect project ID. Leave empty to use the shared default |
magicPublishableKey |
Magic SDK key for email login on WebGL. Without it, email login uses the built-in server OTP flow |
enableEvmXChain |
Enable X-Chain EVM wallet login (beta) — shows installed EVM wallets in the built-in picker (default: off) |
dAppUrl |
URL shown in wallet apps when players approve a connection |
dAppIconUrl |
Icon shown in wallet apps |
walletSignTimeoutSeconds |
How long to wait for wallet approval (default: 120 seconds) |
- Unity 6+ (6000.0)
- .NET Standard 2.1+
- Algorand mainnet (testnet support is on the roadmap)
MIT — see LICENSE.
- Report an issue
- Built on Algorand