RAILGUN SDKs
The RAILGUN SDKs enable development teams to integrate Layer 1 privacy into their dApps or Wallets.
The main purpose of the RAILGUN SDKs is to enable cross-contract calls, in this case the RAILGUN smart contract interacting with an external dApp smart contract whilst exporting RAILGUN’s privacy preservation into the external contract. The RAILGUN SDKs are written in TypeScript and comes in 3 forms depending on the integrating dApps needs:
- RAILGUN Cookbook - Easily integrate RAILGUN into any existing dApp to enable private features such as private lending, private trading, private minting, etc.
- RAILGUN Engine – Low-level version of the SDK for advanced use cases such as forking the RAILGUN system or specialized product requirements.
RAILGUN Cookbook is suitable for most dApp developers integrating RAILGUN. It enables users to call your public smart contract from a private 0zk address. Calls can also be linked together in "Recipes" such that users can combine multiple DeFi actions together in 1 transaction. For example, a user might be able to go from stablecoins in a 0zk address to providing liquidity in a DEX and depositing that liquidity into a yield optimizer like Beefy Finance in the same Cookbook Recipe.
With Wallet SDK, developers can quickly and simply add RAILGUN privacy to their wallets to perform the following RAILGUN actions:
- Generate private keys and 0zk addresses
- Generate deposits into private balances
- Scan transaction history and sync balances through the QuickSync API
- Generate ZK proofs for withdrawals, send transactions, and to initiate and complete cross-contract calls
The above actions are all that is required for a fully featured RAILGUN privacy. The
generateDeposit()
and transact()
functions are contained within the Wallet SDK and are callable by dApps once integrated.The RAILGUN Engine is the low-level version of the RAILGUN SDK. Engine is a dependency of Quickstart, with Quickstart being a ready out of the box version of Engine. By interacting with Engine directly, developers can build specialized product use cases, such as forking Engine for their own purposes.
Links:
Developer Guide - https://docs.railgun.org/developer-guide
RAILGUN Cookbook GitHub: https://github.com/Railgun-Community/cookbook
Wallet SDK GitHub - https://github.com/Railgun-Community/quickstart
Last modified 4d ago