Integrating Polkadot and Parachain on a Hardware Wallet
Oct 22, 2024
Objective
We need to integrate Polkadot (DOT) and its associated parachain tokens into our hardware wallet and desktop app. This means users should be able to securely store and manage these tokens directly within our products.
Why are we doing this?
Polkadot is rapidly growing in popularity, especially after their recent market budget increase to $37 million. We expect a surge in users holding DOT and its associated parachain tokens like ACLA. By supporting these tokens, we can attract a significant number of new users to our hardware wallet and desktop app.
Assumption
Core Functionality: The primary focus will be implementing standard wallet features: sending, receiving, and processing transactions
DApp Integration: We will enable users to interact with Polkadot and ACLA-based decentralized applications (DApps) through WalletConnect integration
Node Operation: We will operate our own node (full node, light node, or even a remote node provider) and uses Polkadot's JSON-RPC API to communicate with the node
User Pain Points or Motivation
Users are increasingly worried about the security of their cryptocurrency assets due to the rising number of hacks targeting centralised exchanges (CEXs) and software wallets
Even hardware wallets, traditionally considered the most secure option, have been compromised in some cases. This has eroded user trust in all forms of digital asset storage
Intrinsic Motivation
Users prioritise the protection of their Polkadot (DOT) and ACLA parachain tokens from theft or loss
Users demand secure storage of their private keys, understanding that losing these keys results in irreversible loss of funds
Users desire a hardware wallet that supports multiple blockchains, including Polkadot and its parachains, for convenient management of their diverse crypto holdings
Extrinsic Motivation
Hardware wallets should look sleek and classy
User is a crypto enthusiast and wants to show-off his hardware wallet
Partnership benefit with the token or blockchain which is supported on the wallet
Connecting with the brand give them a positive experience
Educational Incentives like how to video and daily update by owning a wallet and being part of the community
User Persona
Age - 24 to 45
Demographic - USA, UAE, Europe, el salvador, MENA Region.
Earnings - Above 15,000 USD
User Stories
As a user, I want to securely store and manage my Polkadot (DOT) and ACLA parachain tokens in my hardware wallet
As a user, I want to send and receive Polkadot (DOT) and ACLA parachain tokens to and from my hardware wallet
As a user, I want to have a clear overview of my total Polkadot and ACLA token holdings within my wallet
As a user, I want to track the performance of my Polkadot and ACLA token investments over time
Assumption
User is familiar with the crypto world
User owns crypto assets
User has a basic knowledge of web3 and DeFi
High-Level Solution
Feature and Functional Requirement
Blockchain Integration
We need to integrate with the Polkadot JSON-RPC API or substrate API’s for network integration for Polkadot and ACLA parachain.
Transaction construction and Format
We will be implementing logic for building Polkadot and parachain transactions, including fee calculations, address validation, and data encoding.
Polkadot transaction has these mention common set of basic information:-
Address: The SS58-encoded address of the sender.
Block Hash: The hash of the checkpoint block.
Block Number: The number of the checkpoint block.
Genesis Hash: The genesis hash of the chain.
Metadata: SCALE-encoded metadata for the runtime when submitted.
Nonce: The nonce for this transaction.
Spec Version: The current spec version for the runtime.
Transaction Version: The current version for transaction format.
Tip (Optional): An optional tip to increase transaction priority.
Mode: Indicates whether to verify the metadata hash or not.
Era Period (Optional): The number of blocks after the checkpoint for which a transaction is valid. If zero, the transaction is immortal.
MetadataHash (Optional): The metadata hash which should match the RUNTIME_METADATA_HASH environment variable.
Ref:- https://wiki.polkadot.network/docs/build-transaction-construction
For the Device
Hardware Specification
Microcontroller Upgrade: The microcontroller will require an update to support Polkadot and its parachain formats.
Security Element Compatibility: Existing security elements (cards) will be updated to ensure compatibility with Polkadot and ACLA parachain standards.
Firmware Side
Cryptography Support: The firmware must implement S25519 or Ed25519 cryptographic algorithms for key generation, storage, and usage.
Key Management: The firmware should understand that private keys generated are specifically for Polkadot and will be used for transaction signing.
For the Desktop App
We will introduce a Polkadot account option within the 'Add Account' section. Unlike other blockchains, users will have the flexibility to choose whether they want to create an account on the Polkadot Relay Chain or a specific Parachain.
Select Chain
Upon creating a new account, users will be presented with a choice of chain: Relay Chain or Parachain.
Relay Chain: This is the Polkadot main chain. Users can create or import DOT and other Polkadot-based tokens here.
Parachain: Users can select from a list of available Parachains, with ACLA being the initially active option.
It's important to note that each chain (Relay Chain and Parachain) will be treated as a separate account within the wallet.
Create wallet or import with the seed phrase
Similar to our process for other blockchains, users will have the option to either create a new Polkadot wallet or import an existing one using a seed phrase.
Receive or process txn. Functionality
Once the transaction creation logic is complete, the wallet will be capable of receiving both Polkadot native tokens and ACLA Parachain native tokens.
While processing the txn. Users like sending tokens to another address, interacting with any DApp. We will be implementing two things:-
Implementation of the Txn. Fee
Users will be required to pay a transaction fee for all Polkadot and ACLA Parachain transactions. This fee is calculated as follows:
Fee = base fee + length of transaction in bytes * length fee + weight fee.
Base Fee: A fixed amount.
Length Fee: Determined by the size of the transaction in bytes.
Weight Fee: Based on the computational complexity of the transaction. The specific values for these components will be identical for both Polkadot and ACLA Parachain.
A minimum network fee will be reserved for each transaction to cover transaction costs.
For instance, if a user holds 10 DOT, 0.01 DOT will be automatically reserved, allowing a maximum sendable amount of 9.99 DOT. This mechanism applies to both Polkadot and ACLA Parachain transactions.
Wallet connect integration
We will implement WalletConnect functionality to allow users to connect their hardware wallet to Polkadot and ACLA Parachain-based DApps.
Transaction Processing
When a user initiates a transaction, either from the app or a Polkadot/ACLA Parachain DApp, a familiar transaction confirmation pop-up will appear. This pop-up will display essential transaction details and allow users to adjust the transaction fee. Additionally, we will provide an estimated fee value in fiat currency for better user understanding.
Compatibility with different OS system
The desktop application will be updated to support both macOS and Windows operating systems.
Analytics tools
Mixpanel
Google Analytics
Survey Monkey
Admin portal
Events to track
User Behaviour
Account Creation: Total Polkadot and ACLA Parachain accounts created.
Wallet Import: Number of wallet imports using seed phrases.
Hardware Wallet Connections: Frequency of hardware wallet connections to the desktop app.
Token Management: Number of Polkadot and ACLA Parachain token imports and transfers (send and receive).
User Engagement: Frequency of portfolio views.
User Feedback: Number of feedback submissions.
Active Users: he number of active users on a daily, weekly, and monthly basis connecting their device with the app
Feature Usage: Track which feature is used the most in the App.
User Acquisition and Demographic
User Acquisition Channels: Identify the primary sources of new users (e.g., app stores, referrals).
User Segmentation: Group users based on demographics, behavior, or other criteria to tailor marketing efforts.
North Star Metric
Total hardware wallets units sold.
Roadmap (MVP)
We will be applying the T-Shirt Sizing Method to develop an MVP. In T-shirt sizing, we will be considering a sprint of a week and an increase in size represents an increase in no. of sprints Eg.
XS - 1-week Sprint
S - 2-week Sprint
M - 3-week Sprint
L - 4-week Sprint
Post MVP
Integrating Staking
Integrating staking functionality into our existing hardware wallet platform. This feature will allow users to earn passive income on their crypto holdings by participating in the validation process of supported blockchains.
Benefits of Staking
Increased User Engagement: Staking provides an additional value proposition for our users, encouraging longer-term holding of cryptocurrencies.
Enhanced Revenue Generation: Potential for additional revenue streams through staking fees or commission-based partnerships.
Strengthened Market Position: Differentiates our hardware wallet from competitors by offering a comprehensive crypto management solution.