Verona 백서

Verona

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 54쪽 중 33쪽

Result.contractAddress; } catch (error) { console.log("Error instantiating RUM contract:", error); Alert.alert("Error", "Failed to instantiate RUM contract"); throw error; } }; ``` ## Set up Mobile App We've built a [demo app](https://github.com/burnt-labs/abstraxion-reclaim-demo) to showcase how everything works together. In this example, we retrieve a user's `followers_count` from **X.com** (formerly Twitter) and store that value in their account's user map value within the RUM contract datastore. ### Deploy Required Contracts Go to [https://quickstart.dev.testnet.burnt.com](https://quickstart.dev.testnet.burnt.com/), log in with your wallet, and select the **RUM (Reclaim User Map)** contract type. Then click **Launch RUM & Fund Treasury** to deploy both contracts. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F6LOb4GgW2AZlcrHWfhcm%2Fimage.png?alt=media&amp;token=0e07590c-9d4c-4a76-b7a7-c4d1705ce8e0" alt=""><figcaption></figcaption></figure> ### Automated Installation <a href="#manual-installation" id="manual-installation"></a> 1. For the automated installer, click the "**One-liner (Recommended)**" tab under "**Step 3**" and copy the bash command and execute it in your terminal. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FCNh8v0rJk8TfdBXV8OWY%2Fimage.png?alt=media&amp;token=fef3f8cf-62e0-40c1-bd21-3dc242e277cc" alt=""><figcaption></figcaption></figure> 2. Follow the prompts in the terminal: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FwQlmsMCu8kgyMT94FcXq%2Fimage.png?alt=media&amp;token=cb5de384-517b-4a1b-9c74-c38f91e4df39" alt=""><figcaption></figcaption></figure> 3. Once you've followed all the prompts, the installer will install all the dependencies. You will then need to change in to the app directory: ``` cd xion-rum-quickstart ``` 4. Build and launch the application: To build and run the app, ensure your **emulator**, **simulator**, or **physical device** is running. Then, use one of the following commands based on your target platform to launch the App: {% tabs %} {% tab title="For Android" %} ``` npx expo run:android ``` {% endtab %} {% tab title="For iOS" %} ``` npx expo run:ios ``` {% endtab %} {% endtabs %} ### Manual Installation <a href="#manual-installation" id="manual-installation"></a> 1. Click the "**Manual Setup**" tab under "**Step 3**" and copy the values for use later. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2Ff3OMMGbu5n0evWCn5F5O%2Fimage.png?alt=media&amp;token=c7a9b070-e606-4f2c-844a-bccbfde44c0f" alt=""><figcaption></figcaption></figure> 2. In your terminal clone the repository and change into the newly created project directory: ```bash git clone https://github.com/burnt-labs/abstraxion-reclaim-demo.git cd abstraxion-reclaim-demo ``` 3. Install dependencies: ```bash npm install ``` 4. Create an **`.env.local`** file in root of the project folder and add the environment values from the quickstart portal in "**Step 2**" above: ```javascript EXPO_PUBLIC_TREASURY_CONTRACT_ADDRESS="treasury-contract-address" EXPO_PUBLIC_RPC_ENDPOINT="https://rpc.xion-testnet-2.burnt.com:443" EXPO_PUBLIC_REST_ENDPOINT="https://api.xion-testnet-2.burnt.com" EXPO_PUBLIC_RECLAIM_APP_ID="your-reclaim-app-id" EXPO_PUBLIC_RECLAIM_APP_SECRET="your-reclaim-secret" EXPO_PUBLIC_RECLAIM_PROVIDER_ID="your-reclaim-provider-id" EXPO_PUBLIC_RUM_CONTRACT_ADDRESS="your-rum-contract-address" ``` | Variable | Description | | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | EXPO\_PUBLIC\_TREASURY\_CONTRACT\_ADDRESS | <p>Treasury contract instance used for gasless transactions and grants authorization to execute transactions via the User Map smart contract instance on behalf of users.<br><br>You will also need to add your RUM contract address to the treasury contract permission to allow for executing transactions on the user's behalf.</p> | | EXPO\_PUBLIC\_RPC\_ENDPOINT | RPC endpoint for Verona (default: `https://rpc.xion-testnet-2.burnt.com:443`) | | EXPO\_PUBLIC\_REST\_ENDPOINT | REST endpoint for Verona (default: `https://api.xion-testnet-2.burnt.com`) | | EXPO\_PUBLIC\_RUM\_CONTRACT\_ADDRESS | Your RUM contract instance where the user's follower count will be added to their user map record with their logged in wallet address being the key | | EXPO\_PUBLIC\_RECLAIM\_APP\_ID | App ID for the Application created within the Reclaim platform. | | EXPO\_PUBLIC\_RECLAIM\_APP\_SECRET | App Secret for the Application created within the Reclaim platform. | | EXPO\_PUBLIC\_RECLAIM\_PROVIDER\_ID | Provider ID of the provider added to the Application within the Reclaim platform. This would be found in the **httpProviderId field** in **Twitter User Profile** provider. | 5. Build and launch the application: To build and run the app, ensure your **emulator**, **simulator**, or **physical device** is running. Then, use one of the following commands based on your target platform to launch the App: {% tabs %} {% tab title="For Android" %} ``` npx expo run:android ``` {% endtab %} {% tab title="For iOS" %} ```sh npx expo run:ios ``` {% endtab %} {% endtabs %} # zkTLS Integration using Opacity in a Mobile App The ability to verify real-world facts without compromising user privacy is critical. Traditional methods of user verification can introduce trust assumptions, privacy tradeoffs, and central points of failure. **zkTLS** (Zero-Knowledge Transport Layer Security) bridges this gap by allowing clients to generate verifiable proofs of HTTPS interactions, without revealing the full response or needing to trust the server. This has massive implications for Apps: * **Trustless verification** of real-world data from web2 sources (e.g., social platforms, email providers, SaaS tools) * **Privacy-preserving:** users reveal only what's necessary, not the full data * **On-chain utility:** proofs can be verified by smart contracts for gating access or triggering functionality ## Prerequisites Before you begin, ensure you have the following installed and configured: * [**Node.js** (LTS version recommended) and **npm**](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) * An Android Emulator via [Android Studio](https://docs.expo.dev/get-started/set-up-your-environment?platform=android\&device=physical\&mode=development-build\&buildEnv=local#set-up-an-android-device-with-a-development-build), iOS Simulator via [Xcode](https://docs.expo.dev/get-started/set-up-your-environment?platform=ios\&device=physical\&mode=development-build\&buildEnv=local#set-up-an-ios-device-with-a-development-build), **or** a physical mobile device for testing The following [guide](https://docs.expo.dev/guides/local-app-development) will help you set up your local development environment for Expo. We also have a guide to help [Set up your Verona Mobile Development Environment](/en/build-on-verona/accounts/mobile-app/set-up-mobile-development-environment), which shows how to get your Android emulator and iOS simulator set up. ## Create an Opacity Account **Opacity** is a decentralized identity protocol that allows users to prove facts about themselves, such as social media stats, financial data, or platform activity, using **zero-knowledge proofs (ZKPs)**. Rather than sharing raw data, Opacity enables users to generate cryptographic proofs that can be verified on-chain without revealing the underlying information. In this guide, we’ll use Opacity to let users prove their **Github follower count** without exposing their full profile or login credentials. This is done through Opacity’s integration with trusted data providers like Github, wrapped in a ZK-proof that can be verified by your frontend or smart contract. To get started, you’ll need to: 1. Visit [Opacity](https://www.opacity.network/) and sign up for a developer account. 2. Navigate to the "**Billing**" menu to purchase credits. 3. Select "**API Keys**" from the menu. 4. Click "**New key**" add a label, and select "**Create secret key**" 5. Copy and store the generated key as you'll need it for the demo app. ## Opacity's Verification Contract Opacity provides a verifier contract deployed on Verona testnet that validates zkTLS proof signatures on-chain. This ensures the GitHub data hasn't been tampered with. **Contract Address (Testnet):** ``` xion1n5hj97fw96ef40t6h7e46lqhxsyr6fml02sjfrhk382cdl2z736qnq0yd0 ``` **Query Message Format:** ```json { "verify": { "signature": "0x...", "message": "<data_string_from_opacity>" } } ``` The contract returns `true` if the signature is valid, confirming the data came from Opacity and wasn't modified. ## Deploy Required Contracts Go to [https://quickstart.dev.testnet.burnt.com](https://quickstart.dev.testnet.burnt.com/), log in with your wallet, and select the **User Map** contract type. Then click **Launch User Map & Fund Treasury** to deploy both contracts. 1. For the automated installer, click the "**One-liner (Recommended)**" tab under "**Step 4**" and copy the bash command and execute it in your terminal. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2Fh5KPTgywb8fSE8510lkT%2Fimage.png?alt=media&amp;token=9cc81c10-0353-4912-97b3-058344bcf1b2" alt=""><figcaption></figcaption></figure> 2. Follow the prompts in the terminal: <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FFE5vYpwv2gdWBaqT89MR%2Fimage.png?alt=media&amp;token=a99db874-7467-40c6-aa2b-8217315bcb85" alt=""><figcaption></figcaption></figure> 3. We only need the **User Map** (EXPO\_PUBLIC\_USER\_MAP\_CONTRACT\_ADDRESS) and **Treasury** (EXPO\_PUBLIC\_TREASURY\_CONTRACT\_ADDRESS) contract addresses generated for the demo app. Go into the `xion-mobile-quickstart` directory and copy these values from the `.env.local` file. ### User Map Contract The User Map contract stores arbitrary JSON data per user address. We use it to persist GitHub verification results on-chain. **Execute Message (Store Data):** ```json { "update": { "value": "{\"github\":{\"followers\":7,\"isFamous\":true,...}}" } } ``` **Query Message (Read Data):** ```json { "get_value_by_user": { "address": "xion1..." } } ``` **Data Schema:** ```typescript interface VerificationData { followers: number; // GitHub follower count isFamous: boolean; // true if followers > following verifiedAt: string; // ISO timestamp of verification verificationValid: boolean; // On-chain signature verification result } ``` ## Set up Mobile App We've built a [demo app](https://github.com/emperorjm/opacity-expo-demo) to showcase how everything works together. In this example, we retrieve a user's followers count from **github.com** and store that value in the **User Map** contract datastore. 1. In your terminal clone the repository and change into the newly created project directory: ```bash git clone https://github.com/emperorjm/opacity-expo-demo cd opacity-expo-demo ``` 2. Install dependencies: ```bash npm install ``` 3. Copy the `.env.example` and rename it **`.env.local`** and add the User Map address value generated above to `EXPO_PUBLIC_USER_MAP_CONTRACT_ADDRESS` and add the generated Treasury contract address to `EXPO_PUBLIC_TREASURY_CONTRACT_ADDRESS`. ```javascript EXPO_PUBLIC_RPC_ENDPOINT="https://rpc.xion-testnet-2.burnt.com:443" EXPO_PUBLIC_REST_ENDPOINT="https://api.xion-testnet-2.burnt.com" EXPO_PUBLIC_TREASURY_CONTRACT_ADDRESS="treasury-contract-address" EXPO_PUBLIC_USER_MAP_CONTRACT_ADDRESS="your-user-map-contract-address" EXPO_PUBLIC_OPACITY_API_KEY="your-opacity-app-key" EXPO_PUBLIC_OPACITY_VERIFIER_CONTRACT="opacity-verifier-contract" ``` | Variable | Description | | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | EXPO\_PUBLIC\_TREASURY\_CONTRACT\_ADDRESS | <p>Treasury contract instance used for gasless transactions and grants authorization to execute transactions via the User Map smart contract instance on behalf of users.<br><br>You will also need to add your RUM contract address to the treasury contract permission to allow for executing transactions on the user's behalf.</p> | | EXPO\_PUBLIC\_RPC\_ENDPOINT | RPC endpoint for Verona (default: `https://rpc.xion-testnet-2.burnt.com:443`) | | EXPO\_PUBLIC\_REST\_ENDPOINT | REST endpoint for Verona (default: `https://api.xion-testnet-2.burnt.com`) | | EXPO\_PUBLIC\_USER\_MAP\_CONTRACT\_ADDRESS | Your User Map contract instance where the user's follower count will be added to their user map record with their logged in wallet address being the key | | EXPO\_PUBLIC\_OPACITY\_API\_KEY | API key for interacting with the Opacity platform. | | EXPO\_PUBLIC\_OPACITY\_VERIFIER\_CONTRACT | Validates that the zkTLS proofs were legitimately signed by authorized notary nodes and haven't been tampered with. | 4. Build and launch the application: To build and run the app, ensure your **emulator**, **simulator**, or **physical device** is running. Then, use one of the following commands based on your target platform to launch the App: {% tabs %} {% tab title="For Android" %} ``` npx expo run:android ``` {% endtab %} {% tab title="For iOS" %} ```sh npx expo run:ios ``` {% endtab %} {% endtabs %} <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FblEaouqKmyZlgIegb1d1%2F2026-01-06%2010.09.11.jpg?alt=media&amp;token=d95d07dd-c4c0-4a83-b98d-10695b91a8b7" alt="" width="303"><figcaption></figcaption></figure> # How to Create a Custom Reclaim zkTLS Provider Reclaim Protocol allows users to prove ownership of online accounts in a privacy-preserving, verifiable way using zero-knowledge proofs. In this guide, you'll learn how to create your own custom zkTLS provider that proves ownership of a [Kaggle](https://www.kaggle.com) account by verifying the user’s **email address**. ## Setting Up Your Environment To begin, make sure you have access to an Android phone and download the [**Reclaim Protocol App**](https://play.google.com/store/apps/details?id=com.reclaim.protocol\&hl=en_IN\&pli=1). This mobile application is essential, as it helps the Reclaim Developer Portal to do the actual credential extraction. Next, open your browser and head to the [Reclaim Developer Portal](https://dev.reclaimprotocol.org/explore). After logging in, click on **Account** in the sidebar, then select **My Providers**. This is where you'll manage all the custom data providers you create. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FwBpaKNtOeLr66jqyChZj%2Fimage.png?alt=media&amp;token=dcea0e08-a942-4d56-b1e3-73bbf0720586" alt=""><figcaption></figcaption></figure> Click **New Provider** to begin creating a new source of verifiable data. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FFUJ9jQaMSpXVElrxoPH1%2Fimage.png?alt=media&amp;token=1b10813e-61f6-4b7d-b4c1-5f84da02bb52" alt=""><figcaption></figcaption></figure> ## Linking the App to Your Provider Session Now open the Reclaim Protocol app on your Android device. Enter the session key shown in your browser. This step links your phone to the provider you’re building. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2F3vq3QcGWEdCvddb8Vit9%2Ftelegram-cloud-photo-size-1-5152633146905308737-y.jpg?alt=media&amp;token=df75ff1f-5798-482c-a74d-9749a29a79dc" alt="" width="303"><figcaption></figcaption></figure> Inside the app, you’ll be prompted to enter the URL of a website that contains the data you wish to verify. For this example, enter [www.kaggle.com](https://www.kaggle.com) and log into your Kaggle account. Once you're logged in, return to the Reclaim Developer Portal in your browser. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FN1FSVnz7K34y0RHRPUDZ%2Ftelegram-cloud-photo-size-1-5152633146905308738-y.jpg?alt=media&amp;token=aad289bd-c9c9-410c-b040-e28e8ded6f52" alt="" width="303"><figcaption></figcaption></figure> ## Capturing and Selecting the Right Data Back in the portal, Reclaim will now show you all the HTTP responses it captured while you browsed Kaggle in the app. Use the search bar to locate your **email address** in the captured data. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FqqHrM0clyteWi1xtfLWz%2Fimage.png?alt=media&amp;token=85eb5a08-0f45-4d92-89ed-45409a2a2a5e" alt=""><figcaption></figcaption></figure> Once you’ve found a response that contains it, click **View** to inspect the details. If everything looks correct, click **Add to Provider** to include this data in your custom provider, then click **Next** to proceed. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FLOq2BkZ1xPU2o1fQTDr1%2Fimage.png?alt=media&amp;token=9904e716-64de-4cbc-bd3d-5bba9dff9639" alt=""><figcaption></figcaption></figure> ## Defining the Variables At this stage, Reclaim will use AI to suggest variables that can be extracted from the selected response (e.g., your email field). You can either accept the suggestions or manually choose specific fields you want to use as part of the verification. Click on the variables you would want and click **Accept Suggestion**, then move on by clicking **Next**. <figure><img src="https://3630978198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB5Z5ijJgMx0GJO3l1Il9%2Fuploads%2FxixRXERixvj4ZHFsnBsV%2Fimage.png?alt=media&amp;token=b2f4e275-c666-4243-a8b2-c1827b0debc2" alt=""><figcaption></figcaption></figure> ## Standardizing the Request URL The next step involves standardizing the request URL. This helps Reclaim generalize the proof logic across different users by identifying and marking user-specific parts of the URL (e.g., user IDs or query strings). In the case of Kaggle, the URL does not contain any such identifiers, so you can simply click **Next** if there’s nothing to modify. ## Finalizing Provider Details You’ll now be asked to add general information about the provider. This includes setting a name, description, and most importantly, the source URL, which should be set to [https://www.kaggle.com](https://www.kaggle.com/) for this example. This is essential for the verification process to function correctly. Once your metadata is set, click **Next** to continue. ## Generating a Proof Before your provider can be published, Reclaim requires at least one working proof. To create this: * Scan the QR code shown in the portal using your Android phone, or open the provided link. * This will launch the verifier app and trigger
프로젝트로 돌아가기