Content pfp
Content
@
0 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Been diving into ERC-4337 & smart accounts lately. An interesting use case with positive UX impact -- Session management. An example using an MMORPG: 🧵
1 reply
0 recast
1 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Smart Contract Account Setup: Players create a self-custodied smart contract account at registration. Key parts are split using Multi-Party Computation (MPC) for enhanced security - one part on the player’s device, another secured remotely.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Session Initialization: At login, players provide a signature for a session-specific authorization. This is recorded onchain as a session ID by updating a state variable in the smart contract account. The session ID is unique per session and is secured against unauthorized updates.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Transaction Bundling: Player actions are collected into a UserOperation bundle, reducing the need for individual transaction signatures and streamlining gameplay.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Session-Based Authorization: Actions are authenticated against the session ID via the validateUserOp function to ensure they are part of the current, active session.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Transaction Execution: Actions are executed through the EntryPoint contract, which processes the UserOperation bundle on the blockchain.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Session Termination: Sessions are securely ended by invalidating the session ID with a function call to the smart contract account, which can also require the player’s signature for additional security.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Let's visualize the impact with our MMORPG scenario: Imagine a player, ready to level up their character and arsenal 🗡️ with some strategic trades and purchases.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
The player starts by earning 100 gold (ERC-20) for completing a quest. They're eyeing the Flame Sword 🔥 (ERC-1155), a valuable upgrade for the character.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
With their gold, they purchase the Flame Sword 🔥 for 75 gold, boosting their attack power. In the same session, they list their Ice Sword ❄️ on the market.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
Another player purchases the Ice Sword for 50 gold. Our character (ERC-721) is now equipped with the Flame Sword 🔥, and they're ready for bigger battles.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
All these actions: earning, spending, selling, and equipping, are bundled into a single UserOperation. No multiple signing interruptions, just smooth, uninterrupted gameplay.
1 reply
0 recast
1 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
With just one signature at login, our player has engaged in a full session of economic and gameplay activities. Session over, the player logs out, and with a final signature, all session actions are concluded. Their character is stronger, their wallet is balanced, and they're set for new adventures next time.
1 reply
0 recast
0 reaction

Matt Hamilton pfp
Matt Hamilton
@ham
So… what are your views on ERC-4337 in this case? Pitfalls or enhancements you see? Other use cases this could be applied to that you’re interested in? Would love thoughts.💡
0 reply
0 recast
0 reaction