Skip to content

[Spike] Pollar Wallet Integration – Abstracted Onboarding + Escrow Deployment #24

@techrebelgit

Description

@techrebelgit

[Spike] Pollar (Polaris) Wallet Integration – Abstracted Onboarding + Escrow Deployment

Summary

We want to explore integrating Pollar (Polaris) into the clonable-backoffice as an alternative wallet onboarding and signing experience.

The goal is to evaluate how a fully abstracted onboarding flow (OAuth → wallet → funded account → ready to transact) could replace or complement the current Stellar wallet integration.

This spike focuses on:

  1. Logging in using Pollar (e.g. Google OAuth)
  2. Deploying a Trustless Work escrow using the Pollar wallet

This is an exploratory spike, not a production implementation.

Links:
Pollar Docs
Pollar Github


Context

The current clonable-backoffice uses the Trustless Work wallet provider (@trustless-work/blocks) and Stellar wallet connectors.

We want to test a different paradigm:

→ No wallet installation
→ No seed phrases
→ No trustline setup
→ No explicit transaction signing UX

Pollar provides a full onboarding stack that abstracts all of this:

  • OAuth login (Google, etc.)
  • Automatic wallet creation
  • Deferred funding
  • Trustline setup
  • Fee abstraction

:contentReference[oaicite:0]{index=0}

This could significantly improve UX for non-crypto-native users and expand Trustless Work into more consumer-friendly use cases.


Goal

Validate whether Pollar can:

  1. Replace or sit alongside the current wallet provider
  2. Successfully authenticate a user
  3. Provide a usable wallet address
  4. Be used to deploy an escrow via the Trustless Work API

We are NOT trying to complete the full escrow lifecycle in this spike.


Key Questions to Answer

  • Can Pollar wallet addresses be used directly with Trustless Work?
  • How does signing work for contract deployment?
  • Does Pollar support the transaction flow required by TW escrows?
  • What changes are required to the current wallet abstraction?
  • Can this be modularized cleanly?

In Scope

  • Install and configure @pollar/react

  • Wrap part of the app with PollarProvider

  • Implement a Pollar-based login flow

  • Retrieve wallet address from Pollar

  • Create a separate wallet provider adapter/component

  • Use that wallet to:

    • Call Trustless Work API
    • Deploy an escrow
  • UI can be minimal (buttons + logs is fine)


Out of Scope

  • Full escrow lifecycle (milestones, approvals, release)
  • Refactoring the entire app to Pollar
  • Backend changes unless strictly necessary
  • Production-ready UX or styling
  • Security hardening

Suggested Approach

1. Keep It Modular

DO NOT replace the current wallet system.

Instead:

  • Create a parallel Pollar adapter
  • Example:
    • /lib/wallet/pollarProvider.ts
    • /components/pollar-login.tsx

Goal: future ability to support multiple wallet providers.


2. Minimal Flow

Implement:

Step 1 – Login

login({ provider: 'google' })

Step 2 – Access wallet

  • Extract wallet address from Pollar
  • Log it in UI

Step 3 – Deploy escrow

  • Use existing TW API flow
  • Replace signer/address with Pollar wallet

3. Integration Strategy Options (Explore Both)

Option A — Direct Replacement

  • Treat Pollar wallet as signer
  • Plug into existing escrow flow

Option B — Adapter Layer

  • Create unified interface:
type WalletAdapter = {
  address: string;
  signTransaction: (xdr: string) => Promise<string>;
};
  • Implement:

    • TWWalletAdapter
    • PollarWalletAdapter

Expected Output

A successful spike includes:

  • Working Pollar login (OAuth)
  • Wallet address displayed in UI
  • Ability to attempt escrow deployment
  • Partial or full success deploying escrow

PLUS:

  • Clear notes in PR:

    • What worked
    • What broke
    • Missing capabilities
    • UX implications
    • Recommendation: pursue / not pursue

Acceptance Criteria

  • Pollar SDK installed and configured
  • Login flow working (OAuth)
  • Wallet address retrievable and displayed
  • Escrow deployment attempted using Pollar wallet
  • Code runs locally
  • Findings documented in PR
  • Screenshots or video included

Technical Notes

  • Pollar React SDK:

    • @pollar/react
  • Uses:

    • PollarProvider
    • usePollar()

Example:

const { login, wallet } = usePollar();
  • Requires:

    • Publishable key
    • Testnet configuration

Risks / Unknowns

  • Transaction signing compatibility with TW
  • XDR signing flow differences
  • Fee-bump / sponsorship handling
  • Trustline assumptions
  • Smart contract compatibility

Definition of Success

We consider this spike successful if:

👉 A user can log in with Pollar
👉 We can retrieve a wallet
👉 We can attempt or complete escrow deployment

Even if imperfect, we learn enough to decide next steps.


Branching & PR Rules

Please do not work directly against main.

  1. Create a new branch for this spike:

spike/pollar-wallet-integration

  1. Do all your work on that branch.

  2. Commit only to that branch.

  3. Open your PR into this branch, not main.

  4. In your PR description, include:

    • what you changed
    • what assumptions you made
    • what remains unresolved
    • screenshots or short video
    • setup instructions

This is an exploratory spike — insights matter as much as code.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions