Sign up for Sanctum wonderland and earn points for holding compassSOL! Sign up

Liquid Stake with compassSOL for an 9.77% APY from staking, MEV + fees

Enjoy the freedom of liquid staking in Solana Defi while delegating your stake to the high performance Solana Compass validator. Stake or unstake at any time here, or with a Jupiter swap.

Benefit from our high staking returns and over 2 years experience operating a Solana validator, and receive additional yield from priority fees + MEV tips

Earn 6.8% APY staking with Solana Compass

Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 6.8% APY yield on your SOL, while supporting us to create new guides and tools. Learn more

Stake your SOL

  1. Click to connect your wallet
  2. Enter the amount you wish to stake
  3. Kick back and enjoy your returns
  4. Unstake from your wallet or our staking dashboard

Earn 6.8% APY staking with Solana Compass

Help decentralize and secure the Solana network delegating your stake to us and earn an impressive 6.8% APY yield on your SOL, while supporting us to create new guides and tools.

Learn more

Breakpoint 2023: How Phantom Integrated With Solana Mobile In Purely React Native

An in-depth look at Phantom's integration with Solana Mobile using React Native

The notes below are AI generated and may not be 100% accurate. Watch the video to be sure!

Summary

In a detailed breakdown at Breakpoint 2023, Nick Cruz, a software engineer at Phantom, delved into how Phantom, a popular cryptocurrency wallet, achieved integration with Solana Mobile using a predominantly React Native framework. React Native, a popular framework for mobile app development, enables developers to build mobile applications using JavaScript and TypeScript. Cruz, who has a background in native Android development, shared his insights on how native modules in React Native bridge the gap between JavaScript and native Android code, particularly focusing on the integration with the seed vault functionality of the Solana Mobile Stack.

Key Points:

The Integration Process

Nick Cruz opened the discussion by outlining the need for integrating the Phantom mobile app with the Solana blockchain, an endeavor that would allow for safe and seamless cryptocurrency transactions. The integration process is complex, involving a journey from user interface interactions to the actual transaction on the blockchain. This process includes various steps: starting in the React Native layer, bridging to the native Kotlin layer, interacting with the seed vault, and then reverting the signed transaction back to React Native for dispatch to the blockchain. What stands out in Cruz's explanation is the meticulous design behind the workflow, ensuring secure and efficient user transactions.

React Native's Role

React Native's role is significant as it supports cross-platform development while still allowing developers to execute native code when necessary. This approach provides a balance between the speed of development in React Native and the power and specificity of native development in Kotlin or Swift. Cruz highlighted the convenience and efficiency of this architecture, demonstrating how Phantom could leverage the strength of both JavaScript and native modules.

Seed Vault and Security

Cruz emphasized the security benefits of Solana Mobile's seed vault, which is a secure enclave for storing cryptographic keys embedded in the Saga phone hardware. This feature signifies a substantial advance in mobile wallet security, as it ensures that private keys never leave the safety of the secure enclave and are not directly handled by the Phantom app. Transactions require user approval, further bolstering the wallet's security profile.

Facts + Figures

  • Nick Cruz is a software engineer at Phantom, who previously worked at Airbnb and the life sciences division of Alphabet.
  • Phantom's codebase is 99.5% TypeScript or JavaScript with a tiny percentage (0.5%) of Kotlin.
  • Phantom Mobile is a React Native application, indicating a preference for cross-platform capable frameworks.
  • The seed vault is currently exclusive to the Saga phone and it is where private keys are securely stored.
  • The communication with the seed vault is facilitated using native Android APIs and is not managed in JavaScript.
  • The process of sending a transaction involves packaging a request into an 'intent' which is transferred to the seed vault.
  • The user's approval of a transaction is captured in the seed vault’s UI, which then produces a signed transaction.
  • Signed transactions are returned to Phantom to finalize the transaction and send it to the Solana blockchain.
  • The entire transaction process happens almost instantaneously, emphasizing efficiency and user experience.

Top quotes

  • "Phantom Mobile is a React Native app and this is actually a language breakdown of our Monorepo."
  • "The seed vault then does its thing. It shows signing UI. It approves, we get an approval from the user and it actually signs the transaction."
  • "This is where I'm going to talk about Intents now with Intents are basically messages."
  • "This is what it meant to wrap an intent. We took all this data and put it in this intent api, intent message."
  • "We haven't done a Swift integration, but we might soon."
  • "You don't need to be a fully native app to integrate with the Solana mobile stack, you can be React Native."

Questions Answered

Who is Nick Cruz?

Nick Cruz is a software engineer at Phantom and has the experience of being a native Android engineer at Airbnb and the life sciences division of Alphabet before joining Phantom.

What is Phantom Mobile and why is the integration with Solana Mobile significant?

Phantom Mobile is a cryptocurrency wallet application developed using React Native, aiming to provide a secure and user-friendly platform for crypto transactions. Integrating with Solana Mobile is significant as it allows Phantom to harness the advanced security features of the Solana Mobile stack, particularly the seed vault for secure transaction signing.

How does React Native fit into the integration process with Solana Mobile?

React Native plays a central role in the Phantom app, serving as the cross-platform framework for UI development. However, for actions that require native functionality, such as interactions with Solana's seed vault, Phantom uses native modules in React Native, enabling the app to execute native Android code within the JavaScript environment.

What is the seed vault and how does it enhance security?

The seed vault is a secure component within the Saga phone that stores cryptographic keys within the phone's hardware. It enhances security by ensuring that the keys remain protected in the secure enclave and by requiring user confirmation for transactions, thus reducing the risk of unauthorized access.

Can React Native fully replace native development in blockchain applications?

While React Native offers extensive capabilities and the convenience of cross-platform development, it does not entirely replace native development. As demonstrated by Phantom's integration with Solana Mobile, certain aspects, such as interfacing with hardware security features, still require native code. Native modules in React Native bridge this gap, allowing developers to invoke native functionality as needed.