How to get started in Trustless Work API
You'll have 50 as a request rate limit per client in the API every 60 seconds.
The Trustless Work REST API is designed to offer decentralized escrow solutions by leveraging the power of smart contracts on the Stellar blockchain through Soroban. This API enables platforms and businesses to integrate secure, fast, and transparent escrow services, eliminating the need to rely on centralized intermediaries.
The Trustless Work API is a key component for any platform that requires secure conditional payments. It allows the creation, management, and automation of escrow contracts, providing security for both payers and payees. This API can be used across various industries including e-commerce, SaaS, real estate, freelance marketplaces, and more.
Create and manage escrow contracts: Users can set up payment agreements with specific conditions that must be met before funds are released.
Real-time status updates: The API provides real-time access to escrow statuses, allowing users to verify the state of funds at any time.
Process automation: Through the use of smart contracts, actions such as fund releases, milestone verification, or dispute resolution can be automated.
This API is critical for offering businesses an efficient and secure way to manage payments without relying on third-party services. Trustless Work’s decentralized nature eliminates the risks associated with centralized intermediaries, such as delays or failures. Additionally, being blockchain-based guarantees full transparency and a significant reduction in operational costs.
Transparency: Every transaction is recorded on the blockchain, making it auditable and ensuring that all parties can track the flow of funds.
Low Costs: Built on Stellar, the API benefits from minimal transaction fees compared to traditional solutions or even other blockchain platforms.
Speed: Stellar's fast transaction finality ensures that payments are processed almost in real-time.
Cross-chain compatibility: With USDC and Circle’s cross-chain transfer protocol, the API can operate across multiple blockchains, offering flexibility to businesses.
Freelance marketplaces: Freelance platforms can use the API to manage milestone-based payments, enhancing trust and reducing disputes between clients and freelancers.
High-value e-commerce: In peer-to-peer transactions, escrow ensures that payment is only released once the product has been received and verified.
SaaS providers: Platforms managing recurring payments can leverage the API to release payments upon successful service delivery.
International real estate: Trustless Work helps secure funds in cross-border real estate transactions by releasing them only when all legal and contractual obligations are met.
Legal services: Law firms can manage complex multi-party agreements or settlements without needing manual escrow services.
In summary, the Trustless Work REST API provides a robust, transparent, and cost-effective solution for managing escrowed funds, catering to a wide range of industries and promoting security and trust in digital transactions.
Here you'll find the basic flow in order to use Trustless Work API.
Before you start:
A public and private address must be generated with this stellar resource:
Then stellar funds must be given to this address by placing the public key in this stellar resource:
USDC on testnet faucet Stellar testnet:
To be able to interact with USDC from a stellar address you have to define the trustline. For this you can use this api endpoint:
Normal case where a escrow is created and the escrow are completed correctly:
The escrow contract must be deployed, which in turn initializes the escrow with its metadata.
Among the information returned you will get the id of the contract you have just deployed, which you will need to enter to be able to use the other endpoints.
NOTE: This 50 percent that is being transferred goes directly to the balance of the deployed contract, not to the service provider. The escrow must then be funded so that the service provider can be assured of 50 percent of the escrow value.
To do this, the following endpoint must be executed:
The following endpoint must be executed in order to complete the escrow after mutual agreement:
With this step the other 50 percent of the escrow value will be transferred to the balance of the deployed contract.
After the escrow is completed, the service provider may claim the proceeds of the escrow through this endpoint:
Case in which the contract is deployed and the escrow is initialized and funded but the service provider decides to cancel the escrow:
The escrow contract must be deployed, which in turn initializes the escrow with its metadata.
Among the information returned you will get the id of the contract you have just deployed, which you will need to enter to be able to use the other endpoints.
NOTE: This 50 percent that is being transferred goes directly to the balance of the deployed contract, not to the service provider.
The escrow must then be funded so that the service provider can be assured of 50 percent of the escrow value.
Due to an external cause the service provider decided to cancel the escrow.
The escrow owner (signer) will be able to refund to his account the 50 percent that he financed for the escrow due to the above mentioned situation.
IMPORTANT NOTE: All endpoints related to escrow management return the transaction unsigned. This is done by means of a string returned in XDR (External Data Representation) format, which is a format that stellar uses to encode transactions. This string is what you should use to sign the transaction with the wallet of your choice. After being signed it will return the transaction signed in the same way by means of a string in XDR format.
This string is the one that must be sent to the next endpoint for the transaction to be sent to the Stellar network:
The only endpoints that do not require the previous step since they are signed and sent to the network directly when executed, are the following (mentioning them by the name they have in the documentation):
Invoke Deployer Contract
Get Escrow by Engagement ID
Set Trustline