Skip to content

feat: add wallet-signed proof of life pings - #1052

Open
Agbeleshe wants to merge 1 commit into
Fracverse:masterfrom
Agbeleshe:fix/issue-proof-of-life-ping
Open

feat: add wallet-signed proof of life pings#1052
Agbeleshe wants to merge 1 commit into
Fracverse:masterfrom
Agbeleshe:fix/issue-proof-of-life-ping

Conversation

@Agbeleshe

Copy link
Copy Markdown
Contributor
Screenshot 2026-08-23 at 1 42 00 PM

frontend: Implement Interactive Proof-of-Life Ping Widget and Dynamic Inactivity Countdown

Summary

This PR implements the missing Proof-of-Life Ping workflow for asset owners and improves the inactivity timer so that it updates dynamically after a successful ping.

Previously, InactivityTimerCard.tsx only displayed inactivity countdown information without giving the asset owner a way to actively confirm that they are still present. This meant the frontend lacked the required interaction for resetting the inactivity period and preventing an inheritance plan from progressing toward a triggered or claimable state.

With this update, asset owners can now submit a wallet-authorized proof-of-life ping directly from the dashboard. Once the ping succeeds, the latest activity timestamp is refreshed and the inactivity countdown is recalculated immediately.

What Was Implemented

Interactive Proof-of-Life Ping

Added a Send Proof-of-Life Ping action to the inactivity timer interface.

The asset owner can now initiate a proof-of-life confirmation directly from the dashboard instead of relying on a static inactivity timer.

The flow now:

  1. Detects the currently connected asset-owner wallet.
  2. Generates or prepares the proof-of-life challenge.
  3. Requests authorization/signing through WalletContext.
  4. Submits the signed proof to the backend using the inheritance API helper.
  5. Invokes the configured Soroban ping flow where applicable.
  6. Waits for the ping to be successfully confirmed.
  7. Refreshes the relevant plan data.
  8. Recalculates the inactivity deadline and remaining countdown.

Wallet-Signed Authorization

The proof-of-life action is tied to the asset owner's connected wallet.

For Ed25519-based wallets, the frontend can sign the generated proof-of-life challenge before submitting it to:

POST /api/plans/ping

Where the Soroban-based implementation is being used, the flow can instead authorize or invoke the corresponding smart contract ping operation.

This ensures that simply clicking the button is not enough to reset the inactivity timer. The proof-of-life action must first be authorized by the wallet associated with the inheritance plan.

Dynamic Inactivity Countdown

The inactivity timer has been updated so that it no longer behaves as static dashboard data.

After a successful proof-of-life ping:

  • The latest activity/ping timestamp is updated.
  • The plan's next inactivity deadline is recalculated.
  • The remaining inactivity duration is recalculated.
  • The timer UI refreshes immediately.
  • The user does not need to reload the page manually.

The countdown continues to display the remaining inactivity period based on the latest valid proof-of-life timestamp.

Loading and Submission States

Added appropriate interaction states around the ping workflow.

The interface now handles:

  • Wallet signing in progress.
  • Ping submission in progress.
  • Successful ping confirmation.
  • Wallet signature rejection.
  • Failed API requests.
  • Failed contract interactions.
  • Invalid or disconnected wallet state.
  • Duplicate submission prevention while a ping is already processing.

The Send Ping action is disabled while an existing ping request is being processed to avoid duplicate requests.

Error Handling

Failure states are handled without incorrectly resetting the inactivity timer.

If any part of the flow fails, including:

  • wallet authorization,
  • Ed25519 challenge signing,
  • Soroban invocation,
  • backend validation,
  • network requests,
  • or server processing,

the existing inactivity state remains unchanged.

The inactivity deadline is only refreshed after a confirmed successful proof-of-life submission.

Asset Owner Dashboard Integration

The proof-of-life workflow has also been integrated into the main Asset Owner Dashboard.

The dashboard now:

  • Provides access to the proof-of-life action.
  • Uses the connected wallet from WalletContext.
  • Passes the required plan information into the ping flow.
  • Refreshes plan information after successful submission.
  • Reflects the updated inactivity status immediately.
  • Keeps the inactivity timer synchronized with the latest proof-of-life activity.

API Integration

Updated the inheritance API layer to support proof-of-life submission through:

POST /api/plans/ping

The request can include the relevant information required by the backend, such as:

  • Plan identifier.
  • Asset-owner wallet address.
  • Signed challenge.
  • Signature.
  • Challenge payload.
  • Network information where required.
  • Proof-of-life metadata.

The API helper also normalizes successful and failed responses so that the UI can provide appropriate feedback.

Affected Files

frontend/components/plans/InactivityTimerCard.tsx

  • Added the interactive Send Ping action.
  • Added loading and disabled states.
  • Added proof-of-life submission handling.
  • Added success and error feedback.
  • Added dynamic inactivity countdown refresh.
  • Recalculates timer values after a successful ping.

frontend/app/asset-owner/page.tsx

  • Integrated the proof-of-life flow into the Asset Owner Dashboard.
  • Connected the workflow to the currently active wallet.
  • Connected the timer card to the current inheritance plan.
  • Refreshes plan state after successful proof-of-life confirmation.

frontend/app/lib/api/inheritance.ts

  • Added/updated the proof-of-life ping API helper.
  • Handles requests to POST /api/plans/ping.
  • Supports the signed proof-of-life payload.
  • Normalizes error and success handling for the frontend.

User Flow

The completed user flow is now:

Asset Owner Dashboard

→ View current inactivity countdown

→ Click Send Proof-of-Life Ping

→ Wallet authorization/signature requested

→ Challenge signed by the asset owner's wallet

→ Proof submitted to the inheritance API / Soroban contract

→ Proof validated successfully

→ Latest activity timestamp updated

→ Inactivity deadline recalculated

→ Countdown refreshes automatically

→ Plan remains active and is prevented from progressing toward the inactivity trigger

Validation

The implementation was validated against the expected successful flow:

  • Asset-owner wallet connects successfully.
  • Proof-of-life challenge can be generated.
  • Wallet authorization can be requested.
  • Challenge can be signed using the connected wallet.
  • Signed proof can be submitted through the inheritance API.
  • Successful ping response is handled correctly.
  • Latest proof-of-life timestamp is refreshed.
  • Inactivity deadline is recalculated.
  • Timer updates without manually refreshing the page.
  • Duplicate submissions are prevented while processing.
  • Failed submissions do not incorrectly reset the timer.

Result

The inheritance frontend now provides a complete interactive proof-of-life experience.

Asset owners are no longer limited to viewing a static inactivity countdown. They can actively prove that they are still present through their connected wallet, and a successful proof immediately resets and updates the inactivity countdown shown throughout the dashboard.

This provides the frontend interaction necessary to support the inheritance protocol's proof-of-life mechanism and helps prevent valid asset-owner plans from unintentionally entering the triggered or claimable state.

Closes #1033

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.

frontend: Implement Interactive Proof-of-Life Ping Widget and Dynamic Inactivity Countdown

1 participant