Open Platform, in conjunction with Open State, allows you to access powerful interoperability features that can help grow your online business. Beyond a proof of concept, we have created the Open Platform Payment Gateway plugin in WordPress for WooCommerce. So, if you are an ecommerce application developer or have an ecommerce application that sells products, this is a great fit.
We built Open Commerce with our latest interoperability technology.
We also made it easy to install this plugin to utilize our new blockchain interoperability tools in your business. This means you can take payment using any blockchain’s cryptocurrency without having to create new wallets for every blockchain and track for every transaction.
Open Platform will create wallets using hierarchical deterministic (HD) wallet structure by Trust Wallet, another great open source solution (docs here). From the point of view of an end user, a customer makes a payment in which Open State will track wallet address transactions and let you know about any ongoing transactions with a webhook call.
Currently, Open State is able to track transactions from Bitcoin, Ethereum and Binance Smart Chain. Also, it can track the most popular stablecoins like USDT, USDC, and BUSD. If developers or customers decided not to use our widget for this functionality, they would have to use the native solutions. For example, for Ethereum they must use https://etherscan.io/, for BSC they must use https://bscscan.com, and for BTC they must use https://www.blockchain.com/explorer. So, by using our widget, customers can track all of these transactions from different chains in only one page with a webhook call.
Here is an explanation of HD wallets, as per this technical article:
“Wallets that carry the functionality to derive many different addresses from a single access point are called HD wallets, which stands for Hierarchical Deterministic wallets. When these wallets are first generated, a root seed or key is derived. This is the foundation seed from which all branches and addresses will stem from in a given wallet. In most cases, this key is derived from an entropy standard of 128 or 256 bits. The higher the entropy, the more randomized and secure this seed is. When you connect through your HD wallet, some wallets use slightly different paths for connection. Each path will generate a completely new list of addresses, relative to your root private key. That’s why it’s important to keep derivation paths in mind when troubleshooting issues regarding addresses accessed with hardware wallets.
For example, the general path for connecting to the base Ethereum set of addresses looks like this: m/44’/60’/0’/0. Trezor, MetaMask, Digital Bitbox, Jaxx, and Exodus, MEWconnect are just a few HD wallets that use this path. This sequence is broken down into different sections and changes based on what you’re working with.
The sequence goes: m’ / purpose’ / coin_type’ / account’ / change / address_index. Any change to that path number or sequence will completely alter the addresses you expect to see. Ethereum Classic takes a different path, using this sequence: m/44’/61’/0’/0. Then hardware wallets like Ledger take an even more varied sequence specific to Ethereum Classic: m/44’/60’/160720’/0.”
Here is a brief summary of Trust Wallet:
The figure above gives you a sneak peek of our system architecture and how services communicate with each other. More on this later.
To help you get started so that your business can benefit from Open Platform’s interoperability features and WooCommerce integration, we are providing you with a comprehensive step-by-step guide below. So let’s get started!
GUIDE
Step 1: Create a New Application in Open Platform
5. Click the Add Application button to create a new application. The Application Name and Webhook fields must be filled in. The webhook is used to send notification invocations.
Please note that:
Access and Secret Keys are used by third-party integrations like our WordPress plugin. Users can update their keys in case someone else accessed those keys.
Wallet Addresses are either generated by third-party integrations like our WordPress plugin or by users who can also generate various blockchain addresses.
Private addresses and seed codes are saved in Open Key. After successful wallet generation, its public address will be pushed to Open State to track any payment transactions for the current address. In the diagram above, we can see 3 parts of Open Platform integrated. The user sends a wallet creation request to Open API. Open API then sends requests to Open Key. After wallet generation, Open Key returns only public addresses to Open API. The last step is that Open API will send a public address with an application webhook address to Open State. From that stage, Open State starts to track transactions, and if there is a transaction, Open State will invoke a webhook notification. Our current architecture can track interoperable blockchain transactions, and later definitions.
Here are the GitHub code links to the aforementioned components of Open Platform for your reference:
Open API: https://github.com/OpenFuturePlatform/open-api
Open State: https://github.com/OpenFuturePlatform/open-state
Open Key: https://github.com/OpenFuturePlatform/open-key
WooCommerce Plugin: https://github.com/OpenFuturePlatform/open-wc-plugin
Step 2: How to Integrate the Open Platform Payment Gateway Plugin in WordPress
2. Click the Add New button and search for ‘Open Platform Payment Gateway’. In the search results page, you will see the Open Platform Payment Gateway for WooCommerce.
3. Click Install Now and then activate the plugin. After doing this, you will see that the plugin is activated.
4. Now go to the WooCommerce > Settings > Payments menu to integrate with Open Platform
5. Enable Open Platform Gateway and then click Manage to manage configurations
Step 3: How to Use the Plugin in a Simple E-commerce Website
2. Then, click proceed to checkout. Customers can see the Open Platform Payment Gateway as a default payment gateway to proceed with.
3. After a customer clicks place order to make a purchase, they will be redirected to Open Widget
Please note that if the user enabled test mode and chose Ethereum and Binance, Open API generates two addresses and connects to Ropsten and Binance Smart Chain test networks.
Step 4: How to Track Blockchain Payments
1. Let’s make a payment using Metamask to a Binance address
How Does This All Work?
The WooCommerce system will send a request with a signing request body with the secret key. Also, in the request header, it will send a signed request body and public access key of the application. Additionally, in the body, there will be metadata of products. Metadata are order id, product currency, and payment currency with a timestamp. A simple request template will look like the below curl request:
curl –location –request POST ‘https://api.openfuture.io/public/api/v1/wallet/generate’ \
–header ‘X-API-SIGNATURE: 06b2dd66812aef2e18ac4de998fa69adb541f372abb942ff7262915e085a3576’ \
–header ‘X-API-KEY: op_jGbshr6NCZvQM2rpX4+8’ \
–header ‘Content-Type: application/json’ \
–data-raw ‘{
“timestamp”:“1650258362”,
“metadata”:{
“amount”:“10.00”,
“orderId”:“1”,
“orderKey”:“wc_order_8WtVNDm4E3usj”,
“paymentCurrency”:[“ETH”],
“productCurrency”:“USD”,
“source”:“woocommerce”,
“test”:true
}
}‘
After the request, Open API will send a request to Open Key for generating wallet addresses with payment currencies chosen by the customer. Then, generated addresses will be pushed to Open State to start tracking blockchain transactions. At that moment, Open State will get rates for the given payment currency and product currency from Binance API, saving it to its database. If there is a transaction for generated addresses, it will get it and convert it to the product currency with saved rates and then send a webhook to the customer with the relevant information. Open API has a payment tracking widget page where customers can track their transactions and also pay for the product from that widget page with the MetaMask extension for browsers. So the idea is you don’t need any third party applications to track and pay in cryptocurrencies, you just need to install the Open Payment Gateway plugin as it has everything you need in one page.
We get rates when customers make payment for all allowed blockchains and provide them in a given time period to finish their payments.
Open State Architecture (https://github.com/OpenFuturePlatform/open-state/wiki)
What We’ve Accomplished and Next Steps
So far, the development team has completed the following milestones to help your business applications through the Woocommerce plugin:
The team is hard at work to bring additional developer tools for application developer needs. Here is a glimpse of what we’re looking at and what is to come:
Stay tuned for more updates!