Prism++ Technical Deep Dive

Prism++ Technical Deep Dive

Developer Guide

Findora Leads ZK Development in Blockchain with Prism++

As a leader in zk blockchain technology, Findora is at the forefront of preparing Web3 to enter Web2. One of Findora’s key pieces of infrastructure has been Prism, which enabled the transfer of FRA tokens from the EVM Chain (for programmability) to the UTXO chain (for zk functionality). Prism provided atomic and trustless swaps of FRA tokens without a central intermediary, combining the advantages of each chain model. 


Now, Discreet Labs has launched Prism++, an upgraded version of Prism that allows for the transfer of FRC20, FRC721, and FRC1155 assets between the Findora zkLedger and the EVM ledger.


Prism++ offers enhanced confidentiality features for all asset types, creating transactions where the amount, asset type, and even wallet addresses involved can be encrypted on-chain. Prism++ on Findora enables the creation of business-ready stablecoins, confidential NFTs, and enhanced gameplay in Web3 gaming.


Looking for a High-level explainer?

We’ve created this intro do Prism++ to give you an idea of its potential and why it is a milestone achievement for Discreet Labs


In addition, Prism++ offers a suite of innovative features that cater to the needs of developers, businesses, and users alike, providing a seamless experience for confidential transactions in the blockchain ecosystem. In this tech deep dive article, we will explore the design and architecture of Prism++, highlighting its key features, and its implementation.


Additionally, we will discuss some tools that make it more developer-friendly. We have also open-sourced the code under the GNU General Public License v3.0 to open Prism++ to community development.


By the end of this article, you will have a comprehensive understanding of how Prism++ works and its potential to revolutionize blockchain transactions.

Design and Architecture

The Findora blockchain employs advanced cryptographic techniques to enable confidential transactions. The key to linking those cryptographic methods on the UTXO chain to the EVM-compatible chain is Prism++:

Prism++ serves as an internal bridge between the Findora zkLedger and Findora EVM ledger, offering enhanced zk features for transferring FRC20, FRC721, and FRC1155 assets. It is designed to be developer-friendly, with permissionless asset registration and transaction interfaces defined within the smart contract for ease of use. The bi-chain messaging capability enables direct communication between the UTXO and EVM chains, providing new opportunities for cross-chain interactions. 


Below are the technical specifications of how Prism transfer works between the two chains.


Smart Chain -> Native Chain​ (FRA)

  • User/contract calls depositFRA on PrismXXBridge.
  • PrismXXBridge internally burns the tokens and builds a mint operation to store on contract.
  • At the block end, each mint operation will be consumed.
  • For each mint operation, the coinbase mints the equivalent FRA in the UTXO chain.

Native Chain -> Smart Chain​ (FRA)

  • Users build ConvertAccount an operation and transfer some amount of FRA to BlackHole
  • Blockchain calls withdrawFRA function in PrismXXBridge
  • PrismXXBridge internally mints the equivalent FRA on the EVM chain

Smart Chain -> Native Chain​ (FRC20/FRC721/FRC1155)

  • User/contract approves PrismXXBridge some amount of FRC20 tokens.
  • User/contract calls depositFRC20/FRC721/FRC1155 on PrismXXBridge.
  • PrismXXBridge internally maps FRC20/FRC721/FRC1155 asset (EVM) to a native ASSET (UTXO).
  • PrismXXBridge internally locks the tokens and builds a mint operation to store on contract.
  • At the block end, each mint operation will be consumed.
  • For each mint operation, the coinbase mints the equivalent mapped ASSET.

Native Chain -> Smart Chain​ (FRC20/FRC721/FRC1155)

  • Users build ConvertAccount an operation and transfer some amount of ASSET to BlackHole.
  • Blockchain calls withdrawAsset function in PrismXXBridge
  • PrismXXBridge internally maps ASSET(UTXO) back to FRC20/FRC721/FRC1155 asset (EVM).
  • PrismXXBridge internally releases the equivalent mapped asset(EVM).

Developer Friendliness

The Prism++ SDK provides functional interfaces for interacting with EVM dApps, allowing developers to integrate with existing projects and applications. The SDK abstracts away the underlying complexities of interacting with the blockchain, making it easier for developers to focus on building innovative solutions while ensuring that user-data protection and security are maintained throughout the development process.


One of the key benefits of the Prism++ SDK is that it is highly customizable, allowing developers to tailor the SDK to their specific needs. This customization can range from simple configuration changes to more complex integration with existing systems. This flexibility enables developers to create highly specialized applications that cater to the unique needs of their users. Here are some basic examples of how to utilize the Prism++ SDK:

SDK Initiation

The initiation is the first step before the developer uses any interfaces provided by Prism++.

import * as dotenv from ‘dotenv’;

import { initSdk } from ‘./utils/sdkInit’;

dotenv.config();

async function main() {

console.log(‘Init SDK…’);

await initSdk();

}

Wallet Integration

Wallet instances are the necessary parts for interacting. For any transaction between the EVM chain and the native chain, developers need to initialize both instances of native wallet and the EVM wallet first.

import * as dotenv from ‘dotenv’;

import { initSdk } from ‘./utils/sdkInit’;

import { getNativeWallet, getEvmWallet } from ‘./utils/getWallet’;

import { nativeToEvm } from ‘./prism’;

import { NETWORK_CONFIG } from ‘./config’;

dotenv.config();

async function main() {

// Init SDK

await initSdk();

const findoraSdk = await import(‘@findora-network/findora-sdk.js’);

const { Asset: AssetApi } = findoraSdk.Api;

//Get Wallet

const nativeWallet = await getNativeWallet();

const evmWallet = await getEvmWallet();

}

Send Assets from UTXO Chain to the EVM Chain

import * as dotenv from ‘dotenv’;

import { initSdk } from ‘./utils/sdkInit’;

import { getNativeWallet, getEvmWallet } from ‘./utils/getWallet’;

import { nativeToEvm } from ‘./prism’;

import { NETWORK_CONFIG } from ‘./config’;


dotenv.config();


async function main() {

  // After SDK Init and Wallet Init


  // UTXO->EVM 

  // Send FRA

  await nativeToEvm(nativeWallet, evmWallet, await AssetApi.getFraAssetCode());

  // Send FRC20

  const frc20AssetCode = await findoraSdk.Api.Evm.hashAddressTofraAddress(

    NETWORK_CONFIG.tokens.FRC20,

    );

  await nativeToEvm(nativeWallet, evmWallet, frc20AssetCode);

  // Send FRC721

  const frc721AssetCode = await findoraSdk.Api.Evm.hashAddressTofraAddressByNFT(

    NETWORK_CONFIG.tokens.FRC721, //  NFT contract address on EVM

    ‘1’, // nft tokenID on EVM

    );

  await nativeToEvm(nativeWallet, evmWallet, frc721AssetCode);

  // Send FRC1155

  const frc1155AssetCode =

      await findoraSdk.Api.Evm.hashAddressTofraAddressByNFT(

          NETWORK_CONFIG.tokens.FRC1155, // NFT contract address on EVM

          ‘0’, // nft tokenID on EVM

        );

  await nativeToEvm(nativeWallet, evmWallet, frc1155AssetCode);

}

Send Assets from the EVM Chain to the UTXO Chain

import * as dotenv from ‘dotenv’;

import { initSdk } from ‘./utils/sdkInit’;

import { getNativeWallet, getEvmWallet } from ‘./utils/getWallet’;

import {

evmToNativeOfToken,

evmToNativeOfFRC721,

evmToNativeOfFRC1155,

} from ‘./prism’;

import { NETWORK_CONFIG } from ‘./config’;

dotenv.config();

async function main() {

// After SDK Init and Wallet Init


// UTXO->EVM console.log(‘Run – Evm To Native’);

// Send FRA

await evmToNativeOfToken(

nativeWallet,

evmWallet,

‘0x0000000000000000000000000000000000001000’,

‘FRA’,

);

// Send FRC20

console.log(‘2、[send FRC20]’);

await evmToNativeOfToken(

nativeWallet,

evmWallet,

NETWORK_CONFIG.tokens.FRC20,

‘FRC20’,

);

//Send FRC721

console.log(‘3、[send FRC721]’);

await evmToNativeOfFRC721(

nativeWallet,

evmWallet,

NETWORK_CONFIG.tokens.FRC721,

‘0’, // tokenID

);

// Send FRC1155

console.log(‘4、[send FRC1155]’);

await evmToNativeOfFRC1155(

nativeWallet,

evmWallet,

NETWORK_CONFIG.tokens.FRC1155,

‘0’, // tokenID

‘1’, // token amount , amount of nft 1155 to be transferred

);

console.log(‘End!’);

}

Conclusion

In this technology deep dive, we have explored the design, architecture, and key features of Prism++, an upgraded version of Prism on the Findora blockchain. Prism++ provides enhanced zk features for FRC20, FRC721, and FRC1155 assets, enabling EVM-native assets to be bridged to the Findora zkLedger for confidentiality.


Prism++ is a pioneering solution that facilitates seamless interaction between the UTXO and EVM layers, marking a significant advancement in the realm of selectively transparent blockchain transactions. With a bi-chain messaging protocol, a developer-friendly environment, and an open-source, community-focused approach, Prism++ has the potential to revolutionize confidential transactions in the blockchain ecosystem.


As Web3 continues to grow, on-chain confidentiality and security will remain a top priority for developers and users alike. With Prism++, Findora is in a prime position to lead in both areas. 


We encourage developers, researchers, and enthusiasts to actively engage with the project, contribute to its ongoing improvement, and build upon its foundations to create new and innovative selective transparency solutions.


About Findora

Findora is a Layer-1 protocol delivering zero-knowledge solutions to Web3.


Findora integrates two ledgers into a single chain: an EVM ledger for interoperability and a UXTO ledger optimized for zk operations. This dual-layer architecture lets Findora encrypt blockchain data for programmable transparency and public use. By providing new use cases, Findora’s zk tech prepares Web3 for real-world adoption.


We appreciate our developers and would love to onboard you to the Findora ecosystem! Please reach out, and join our social channels for more.


Discord | Twitter | Reddit | Telegram | YoutubeLinkedIn | Facebook | Newsletter


Sunsetting the Findora Grant Program
In October, 2021, the Findora Ecosystem Grant Program was launched to support research, development, liquidity and infrastructure projects on Findora. As an inbound-reliant program, it became quite labor intensive and…
Solving the Integration Puzzle: Bringing Zk to EVM Chains and Dapps
Findora is unlocking Zk by making it easily accessible to Solidity developers.Why Zk Matters to Web3Perhaps no technology holds more potential for Web3 than zero-knowledge cryptography, which promises to transform…
Enders Gate on Findora GSC
Introducing Enders Gate and zkGaming on Findora GSCs
Findora GSC and the zkGaming SDK will bring zkGaming to Web3Trading cards, beautiful animations, and hand-drawn NFTs – Enders Gate won’t just be exciting to play; it’s a perfect example…