Circle Internet Financial
Circle Internet Financial Logo

Sep 23, 2024

November 21, 2023

An Overview of Circle's Web3 Services Platform

what you’ll learn

Circle offers an enterprise-grade Web3 services platform, complete with a diverse set of APIs and SDKs to build decentralized applications. Learn more.

An Overview of Circle's Web3 Services Platform

Here is an overview of Circle's Web3 Services

An Overview of Circle's Web3 Services

Users navigating the Web3 space face significant challenges, leading to billions of dollars in losses each year. A major hurdle is the poor user experience, which hampers universal adoption. Core applications in Web3, including wallets, NFTs, and DeFi platforms, are notorious for their steep learning curves. This is particularly true for users accustomed to Web2, as they find concepts like using ETH for gas payments complex and hard to grasp. Additionally, even seasoned Web3 users often struggle with the nuances of securing their wallets and digital assets.

Circle is making Web3 easier for developers and users alike with enterprise-grade Web3 services, complete with a diverse set of APIs and SDKs to build decentralized applications via a seamless, blockchain transaction experience.

Let’s walk through the core offerings of Web3 services, including what each product achieves and how Circle makes development seamless for engineers to build UX-friendly apps for end-users. We’ll look at Programmable Wallets, the Smart Contract Platform, and its associated webhooks and APIs.

Sign Up for a Circle Developer Account

Before we tour the Circle’s Web3 Services, you’ll need to create a Circle Developer account. If you don’t already have one, you can do so for free by visiting https://login.circle.com/ and clicking on the Sign Up button in the top right corner.

image2-3

Once an account has been created, you should be able to visit the Web3 Services homepage and see something like this:

image5-3

On this page, you’ll find all the docs for more information on how to start building with Circle APIs and SDKs.

On the left pane, you’ll see the various offerings of Circle Web3 Services: API keys, API logs, webhooks, Programmable Wallets, Smart Contract Platform, and more.

In the next few sections, we’ll look in detail at these offerings. Let’s start with Programmable Wallets.

Programmable Wallets

A Brief Overview of Wallets

Wallets are a fundamental component of any public blockchain ecosystem. In order to interact with a blockchain, conduct transactions, and hold digital assets (stablecoins, tokens, NFTs, etc.), you need a wallet. Since public blockchains have no central authority keeping track of users, the wallet takes its place as the user account.

Most wallets have two components: a private key and a wallet address. A private key is a large hexadecimal number that should be kept secret at all times. Think of it as the password of the wallet. If a private key is compromised, the wallet is irreversibly compromised as well.

Most of the difficulty associated with using Web3 wallets stem from the delicate nature of these private keys. It’s hard to simultaneously store and remember your keys while also ensuring that they’re not compromised. The most popular wallets in use today employ recovery phrases, or a mnemonic consisting of a dozen English words, to make wallet usage a little easier—but even then you are still expected to store those mnemonics safely.

Programmable Wallets*

To solve the UX problem of wallets, Circle created Programmable Wallets—a Wallet as a Service that simplifies creating and managing secure Web3 wallets and their private keys.

Programmable Wallets allow developers to create secure, embedded Web3 wallets that abstract away the use of private keys and instead use the familiar UX associated with traditional Web2 offerings like Google, Meta, and Apple.

image12

Programmable Wallets eschew the notions of keys and wallet recovery phrases, and provide the end-user with familiar paradigms such as a username, email, PIN, and security questions. In doing so, Programmable Wallets provide the following advantages:

  1. Familiar UX - With Programmable Wallets, users can’t tell the difference between their web2 and web3 experience; by using mechanisms like PINs and security questions, conducting secure transactions through wallets becomes as simple as using a well-designed iOS or Android app.
  2. Simple access - In order to access their wallet, users will only need to remember a PIN or answers to security questions; they do not remember a random set of words.
  3. Advanced security - Circle ensures that the easy UX does not come at the cost of security by employing advanced MPC technology.

In the near future, apps that embed Programmable Wallets can deliver gas-free transactions, thus making adoption even simpler.

Developers also enjoy a host of benefits from using Programmable Wallets. Some of the primary ones include:

  1. More functionality with less code - Developers can create and manage wallets with easy-to-use REST APIs and mobile SDKs.
  2. Blockchain agnostic - Developers can deploy wallets to multiple blockchains as easily as changing a parameter in a REST API call.
  3. Operations monitoring - Transaction logs and error monitoring give you the detailed information you need to ensure that you can safely deploy and maintain your wallet solution.

The greatest advantage of using Programmable Wallets is the flexible infrastructure models available to developers: User-Controlled Wallets and Developer-Controlled Wallets. Which model you choose offers distinct advantages and decides who controls the assets in a wallet.

User-Controlled Wallets

If you want your users to have full control over their wallets, including explicitly authorizing every transaction, you can use user-controlled wallets. With this model, you grant full autonomy to your users. They set up a PIN code for authorization and are responsible for their own private keys. This model prioritizes user privacy and control.

The downside with this option is that users are once again responsible for holding their wallet secrets—such as their PIN.

Developer-Controlled Wallets

If you instead prefer to abstract away all these details for your users, you can conduct transactions on their behalf using developer-controlled wallets. With this model, developers retain control over the users’ wallets. They can send and receive digital assets, interact with smart contracts, mint NFTs, and more, all on behalf of the user. Users get the benefits of blockchain without ever needing to understand blockchain.

The caveat, of course, is that you, as the developer, have absolute ownership over the user’s assets. In this model, you prioritize UX over user privacy and control.

Getting started with either type of programmable wallet is straightforward. You can use the documentation available here.

Setting Up a Programmable Wallet—API Keys and API Logs

Developers interact with Programmable Wallets using RESTful APIs. To set up a Programmable Wallet, you need a Circle API key. Click on the API Key option from the menu on the left.

image11

From this page, click on Create a Key.

image3-4

Upon clicking Create Key, you will receive an API key which you must store safely as it cannot be retrieved if lost. (In such a case, you’ll have to create a new key.)

image14

All the requests that you (or your users) make to the Circle API using your keys will be recorded in the API Logs page. For instance, if you called the create wallet endpoint, you would see this transaction being recorded on this page.

image7-3

As mentioned earlier, Circle allows the creation of two kinds of programmable wallets: user-controlled and developer-controlled.

Both wallets come with their own quickstart guides that can be found on their respective pages.

image6-3
image4-3

Regardless of the wallet type you choose, our console provides a Dashboard with an overview of your Programmable Wallets, the transactions being conducted, and the parties involved (users or wallets depending on your choice).

Webhooks and Notifications

Webhooks are a feature that allow you to set up notifications for Programmable Wallets (a feature that is not natively available with most wallet solutions). For example, you might want to notify users when they receive an NFT or a token, or inform users when their transaction has completed.

You can create webhooks straight from the console by clicking on the appropriate option in the left pane.

image8-2

You can subscribe to status notifications by clicking on Add a Webhook. For a quick demo, you can use webhook.site to get an endpoint URL that allows you to easily inspect, test and automate the incoming HTTPS request.

Click Add Webhook, and you should see a message that you have subscribed to your endpoint successfully:

image9

You can use Webhooks and Notifications to take actions such as initiating challenge flows and verifying digital signatures. Check out the webhook docs available in the Circle console for more information.

Smart Contracts*

Smart contracts power almost every major decentralized application in the world today, including sidechains like Polygon, L2s like Optimism, loan protocols such as Compound, and NFT marketplaces like OpenSea.

The vast majority of smart contracts are written in Solidity. Interacting with these contracts typically requires knowledge of components like ABIs, and Ethereum development libraries like Ethers and web3.js.

image10

With the introduction of the Smart Contract Platform, smart contracts are made easier. Smart Contract Platform allows developers to create, deploy, and execute smart contracts via a console or APIs.

For example, developers can import any contract on any major blockchain (such as Polygon, Avalanche, and Ethereum) and convert the smart contract’s core login into an easy-to-use universal REST API. Developers, with or without Solidity experience, can now work with smart contracts seamlessly.

Let’s see this in action. Toggle to the Contracts page (from the menu on the left). Next, click on Import.

You can import any contract directly into Circle using just the contract address and the correct blockchain. For the purposes of this tutorial, let’s use the contract deployed at 0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97 on the Polygon Mumbai testnet. This is the official USDC contract on Mumbai.

image13

Once this is done, Circle automatically converts all functions and variables available in the contract into REST endpoints.

image1-Nov-19-2023-03-26-03-9018-AM

Reading and writing from the contract is now as simple as sending GET and POST requests. You no longer need knowledge of Solidity to work with this contract.

Smart Contract Platform also provides code snippets that work with the contract’s functions.

For example, in order to call the implementation function, you would use the following snippet:

import axios from 'axios';const options = {  method: 'POST',  url: 'https://api.circle.com/v1/w3s/contracts/018b8b5e-cfc2-71ed-a39a-fbc35eae8876/read',  headers: {    Authorization: 'Bearer ${API_KEY}',    accept: 'application/json',    'content-type': 'application/json'  },  data: {abiFunctionSignature: 'implementation()'}};try {  const { data } = await axios.request(options);  console.log(data);} catch (error) {  console.error(error);}


Smart Contract Platform offers snippets from over a dozen languages including JavaScript, Kotlin, and Python. For a particular language, it also provides sub-options based on the packages you prefer to use in your application (such as Axios in JavaScript).

Conclusion

Circle’s Web3 Services solve some of the most challenging problems for users and developers experiencing and building in Web3. Programmable Wallets, webhooks, and Smart Contract Platform offer a better experience for developers and users.

New call-to-action

*Programmable Wallets and Smart Contract Platform application programming interfaces (“API”) are offered by Circle Technology Services, LLC (“CTS”). CTS is not a regulated financial services company and the APIs do not include financial, investment, tax, legal, regulatory, accounting, business, or other advice. For additional details, please click here to see the Circle Developer terms of service.

Related posts

Now Available: Native USDC on Sui

Now Available: Native USDC on Sui

October 8, 2024
Migration Guide: Bridged to Native USDC on Sui

Migration Guide: Bridged to Native USDC on Sui

October 8, 2024
Web3 Services: September 2024 Updates

Web3 Services: September 2024 Updates

October 1, 2024