{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d87973f3-1cf3-4c8a-983e-ded44975e4c5","name":"sms-wallet","description":"## Overview\n\nThe SMS Wallet is a lightweight non-custodial wallet solution for users to quickly create a wallet bound to their phone number, receive (or purchase) inexpensive NFTs, showcase their NFTs, and to hold a small amount of crypto assets. The wallet primarily operates on a mobile browser, and is recoverable using text message verification codes in combination with a QR code saved by the user during the wallet’s creation.\n\nOnce created, some operations for the wallet may also be completed by text message commands. These operations allow NFTs to be minted on or transferred to the user’s SMS wallet. The wallet may also allow the user to give the operator (a server) the custody over some assets for specific purposes, such as transferring native assets or NFTs to specific addresses. This expands the scope of actions that can be completed solely with text messages commands.\n\nThe SMS Wallet may also allow a user to directly purchase NFTs using credit cards, or claim NFTs for free in some instances. During this process, some native assets (ONE) may also be sent to the user’s wallet as gifts and to provide sufficient gas fees for future transactions. The SMS Wallet may also allow purchase of native assets using credit cards. However, such purchases should be exclusively handled in pop-up widgets by low-friction fiat-gateways (Transak, Simplex) with money-transmitter licenses, and the users must be promptly notified so.\n\nThe SMS Wallet also provides the user a way to off-board when the user accumulates a meaningful amount of assets. In one click, the user may transfer all assets to a standard private-key based wallet such as MetaMask. The user will also be provided with an option to create a smart contract wallet (such as 1wallet) following a usual onboarding process, and transfer all assets there in one-click.\n\nFor more information see the [wiki](https://github.com/polymorpher/sms-wallet/wiki)\n\n***Note: The data used in these examples are from a test phone number used for development purposes only.***\n\n***Information such as private keys, and seed information should never be shared for real sms-wallets.***\n\n## **Technical Design**\n\nPlease read the [sms-wallet wiki](https://github.com/polymorpher/sms-wallet/wiki#technical-description) for a complete design\n\n### **Key Design Elements**\n\nFor the purposes of this section, we follow these notations:\n\n```\nn - user's phone number\nz - server secret (transient), 256 bit\ns - client generated private key, 256 bit\np - client generated encryption secret, 256 bit\nh - the keccak256 hash function\ne - users encrypted private key\nq - hashed phone or encryption secret\nt - time used to generate one time passwords (otp)\nenc - a symmetrical encryption algorithm, e.g. AES-CBC with p as initial vector. Here, enc(a, b) means to encrypt b using secret a,\ndec - the corresponding symmetrical decryption algorithm. Here, dec(a, b) means to decrypt b using secret a\notp - the TOTP algorithm, otp(a, t) means to generate the TOTP for time t using a as the secret\n\n```\n\n### **Environment Variables**\n\nFollowing are the environment variables used in this postman collection to interact with the sms-wallet server when testing locally.\n\n| **Variable** | **Sample Value** | **Description** |\n| --- | --- | --- |\n| url | [https://localhost:8443](https://localhost:8443) | The sms-wallet server URL |\n| phone | +14158401410 | The users phone |\n| address | 0xa49e814bdf8a330cf4f5aae76b048241fcfb260e | The users wallet address |\n| ekey | 2a577b38c9c542db6d372acd4578a83146c007557646be69bdc919977637aef1 | The users encrypted key |\n| eseed | 5b8947c0682bdb4b7708e074e42cd5ad7f30c69a2f8d90b989253ad92c3e5b43 | The seed used to encrypt the users key |\n| signature |  | The users signature for a transaction |\n\n## **Persistence Layer Overview**\n\nThe sms-wallet uses two persistence layers. Local storage on the users phone or browser and a dataStore currently hosted on Google Cloud Data Store\n\n*Note: for readability we are showing the JSON representation of the stored data. We are using sample data for the test wallet created for documentation purposes.*\n\n### **Local Storage**\n\nOn the users device the following objects are persisted. Once again note the sample data provided here is from a test phone number set up for documentation purposes. None of this information should ever be shared by the user.\n\nWithin the local storage there are four storage objects saved as follows\n\n#### balance\n\nHolds the users balance information\n\n``` json\n{\n    \"_persist\": {\n        \"version\": -1,\n        \"rehydrated\": true\n    },\n    \"0xa49e814BdF8A330cf4f5aAe76b048241FCFb260e\": {\n        \"balance\": \"100000000000000000000\"\n    }\n}\n\n```\n\n#### **global**\n\nHolds global information for the users phone\n\n``` json\n{\n    \"next\": \"{}\",\n    \"prefilledPhone\": \"null\",\n    \"_persist\": {\n        \"version\": -1,\n        \"rehydrated\": true\n    }\n}\n\n```\n\n#### **root**\n\nHolds root information for the phone including the users privatekey and eseed.\n\n``` json\n{\n    \"balance\": {\n        \"0xa49e814BdF8A330cf4f5aAe76b048241FCFb260e\": {\n            \"balance\": \"100000000000000000000\"\n        },\n        \"_persist\": {\n            \"version\": -1,\n            \"rehydrated\": true\n        }\n    },\n    \"global\": {\n        \"next\": {},\n        \"prefilledPhone\": null,\n        \"_persist\": {\n            \"version\": -1,\n            \"rehydrated\": true\n        }\n    },\n    \"wallet\": {\n        \"0xa49e814BdF8A330cf4f5aAe76b048241FCFb260e\": {\n            \"phone\": \"+14158401410\",\n            \"address\": \"0xa49e814BdF8A330cf4f5aAe76b048241FCFb260e\",\n            \"pk\": \"100fe3ae0181ea1e131eae665ca634446e81faa43d181eef6fc937b08c0200df\",\n            \"eseed\": \"5b8947c0682bdb4b7708e074e42cd5ad7f30c69a2f8d90b989253ad92c3e5b43\"\n        },\n        \"_persist\": {\n            \"version\": -1,\n            \"rehydrated\": true\n        }\n    },\n    \"_persist\": {\n        \"version\": -1,\n        \"rehydrated\": true\n    }\n}\n\n```\n\n#### **wallet**\n\nHolds the users waller information\n\n``` json\n{\n    \"_persist\": {\n        \"version\": -1,\n        \"rehydrated\": true\n    },\n    \"0xa49e814BdF8A330cf4f5aAe76b048241FCFb260e\": {\n        \"phone\": \"+14158401410\",\n        \"address\": \"0xa49e814BdF8A330cf4f5aAe76b048241FCFb260e\",\n        \"pk\": \"100fe3ae0181ea1e131eae665ca634446e81faa43d181eef6fc937b08c0200df\",\n        \"eseed\": \"5b8947c0682bdb4b7708e074e42cd5ad7f30c69a2f8d90b989253ad92c3e5b43\"\n    }\n}\n\n```\n\n## dataStore\n\nThe dataStore is hosted on Google DataStore and holds the following information for each user\n\n``` json\n{\n    \"Key\": \"user_dev name:050e3a80-1e57-11ed-bcaa-c5955727d958\",\n    \"Key literal\": \"Key(user_dev, '050e3a80-1e57-11ed-bcaa-c5955727d958')\",\n    \"URL-safe key\": \"ag9zfnNtcy13YWxsZXQtMDByMgsSCHVzZXJfZGV2IiQwNTBlM2E4MC0xZTU3LTExZWQtYmNhYS1jNTk1NTcyN2Q5NTgMogEKc21zLXdhbGxldA\",\n    \"address\": \"0xa49e814bdf8a330cf4f5aae76b048241fcfb260e\",\n    \"creationTime\": \"1660759461635\",\n    \"ekey\": \"2a577b38c9c542db6d372acd4578a83146c007557646be69bdc919977637aef1\",\n    \"eseed\": \"5b8947c0682bdb4b7708e074e42cd5ad7f30c69a2f8d90b989253ad92c3e5b43\",\n    \"id\": \"050e3a80-1e57-11ed-bcaa-c5955727d958\",\n    \"phone\": \"+14158401410\",\n    \"timeUpdated\": \"1660759461635\"\n}\n\n```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"6221615","team":3893964,"collectionId":"d87973f3-1cf3-4c8a-983e-ded44975e4c5","publishedId":"VUjTmPor","public":true,"publicUrl":"https://documenter-api.postman.tech/view/6221615/VUjTmPor","privateUrl":"https://go.postman.co/documentation/6221615-d87973f3-1cf3-4c8a-983e-ded44975e4c5","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2022-08-17T20:00:18.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/3295bec1790e86649d93f1b7b1b7d461cc09a286eaa7f83ca0b3a079d2220b58","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/VUjTmPor"}