Skip to content

Conversation

@Hallmane
Copy link
Contributor

@Hallmane Hallmane commented Jul 31, 2025

Problem

Currently, Hyperware processes that require blockchain interaction must manage their own cryptographic keys and construct raw transactions. This is complex and error-prone.


Solution

Hyperwallet could solve that through being a service that provides Hypeware-process-isolated wallet management. It acts as a trusted "wallet-as-a-service" provider, allowing applications to perform cryptographic operations pretty intuitively.


Initially this was developed as a stand-alone process paired with the development of Hypergrid , so most of the focus has been on wallet operations in that scope.

TBD: when is this in good spot to merge-in as a distro package? The main issue would be to have to do breaking changes between versions.


Note: There has been no work in mutating this from a standalone process to an actual package yet.


Quick overview

A) This PR adds two main components:

  1. A new hyperwallet package: This is the standalone server process that manages all state, permissions, and cryptographic operations.

  2. A new hyperwallet_client module within hyperware_process_lib: A client library that provides functions for all other processes to interact with the Hyperwallet service. PL branch

B) The core design principle is Process Isolation: wallets are strictly owned by the process that creates them, and no other process can access them.

C) Each new or updated process needs to go through a little Handshake flow.

  • Handshake:
    1. ClientHello: Client introduces itself and its version.
    2. ServerWelcome: Server (should) respond with its version and capabilities (supported operations, chains).
    3. ClientRegister: Client declaratively states its required permissions.
    4. ServerComplete: Server confirms registration and returns a session_id.

there's also the initialize function the hyperwallet_client lib.

    // Initialize hyperwallet connection using new handshake protocol
    let config = HandshakeConfig::new()
        .with_operations(&[
            Operation::CreateWallet,
            Operation::SendEth,
            Operation::EstimateUserOperationGas,
            Operation::BuildAndSignUserOperation,
            Operation::SubmitUserOperation,
            Operation::GetUserOperationReceipt,
            Operation::ConfigurePaymaster,
        ])
        .with_name("hypergrid-operator");

    match hyperwallet_client::initialize(config) {
        Ok(session) => {
            info!("Hyperwallet session established successfully");
            state.hyperwallet_session = Some(session);
        }
        Err(e) => {
            error!("FATAL: Hyperwallet initialization failed: {:?}", e);
        }
    }

When an application is updated and requires new permissions, it declares its new full set of requirements during the handshake on its next startup. The Hyperwallet process updates the permissions, along with a version change (should be a bump)

Each handshake establishes a session identified by a session_id, mainly to make it easier to handle wallets imported/generated with a password.


TODO:

  • remove ugly json! macros (and update process lib with more types)
  • it currently has a UI folder, but it hasn't been developed on for a while - probably scrap until there's a good reason for its existence.
  • update individual wallet limits and tracking.
  • update handshake versioning check.
  • better hypermap integrations .
  • cleaning.
  • update README.
  • something else that I've probably forgotten about

@Hallmane Hallmane requested a review from nick1udwig July 31, 2025 09:34
@nick1udwig nick1udwig merged commit 49b884a into develop Aug 12, 2025
1 check passed
@nick1udwig nick1udwig deleted the hyperwallet_new_package branch August 12, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants