---
# System prepended metadata

title: 'Solana <> Torus <> USDC, payment app proposal (SolPay)'

---

# Solana <> Torus <> USDC, payment app proposal (SolPay)
*- similar functionality to Venmo.* where users can send USDC to contacts via email address (and perhaps phone number moving forward)

## Overview

1. Torus infra will provide user key management.
2. Solana will be used to host the smart contract for claims (see below)
3. USDC will be used as a transfer from one email to another. (email can virtually be replaced with any user identifier. )
4. Fiat-crypto and KYC via binance pay API (or others an aggregation)

## Custodial vs Non-custodial

While a custodial solution maybe possible, going non-custodial: 
- saves us the hassle of future legal, 
- a more robust n/m oracle system instead of a central entity for lookups and claims
- i believe with our current structures/entities lower development time


## Claims contract
```
{
	var pubKeyMap<email, secpPublicAddress>;
	var balances<secpPublicAddress, amount>;
	
	// updates the balance with the amount
	 function deposit(email, amount)

	// verify the secp265k1 signature and return the claim account to edPublicAddress
	function signatureVerification(signature, secpPublicAddress, edPublicAddress) 
}
```

### 1. Create account 
*Bob wants to create a new account*
1. Bob will signup on SolPay using google login. Torus nodes will assign him a secp256k1 key. 
2. We can use this key to generate a complimentary Solana key (ed25519 key) deterministically. This will be bob’s private key. 
3. (Optional) Bob will create a signature to claim the amount from the smart contract. 

### 2. Send money ahead of account creation
*Bob wants to send 10 sol tokens to Alice. But Alice does not have an account yet*

1. Bob can call keyAssign API (Torus nodes) to assign a key for Alice (alice@gmail.com). (Identifier - email address)
2. Bob can send 10 sol tokens to the claims contract with Alice’s email address. The contract will update the map with a public key from step 1, i.e.,  <alice@gmail.com, publicKey>. Then the contract will update the balances map with 10 sol tokens.
3. When Alice signs up using alice@gmail.com, she can use the signature to claim the tokens from the claims contract. 
