The Stellar network is an open-source, distributed blockchain-based ledger and database that enables cross-asset value transactions, including payments. Lumens (XLM) are Stellar’s native digital assets (XLM). In other words, Stellar is the payment network (via Horizon API and Stellar Core) and Lumens (XLM) is the cryptocurrency.
Most applications may communicate with the stellar network through Horizon, which is a RESTful HTTP API server. It enables us to send transfers to the network, monitor the status of accounts, and subscribe to event streams.
Stellar facilitates multi-currency transactions since Lumens, the digital currency used to enable multi-currency transactions, serves as a bridge. Transactions such as sending money in EUR and then getting it in USD. XLM is the automated intermediary that enables such a process to take place at a low cost.
How to Build a Stellar Account
We would need two keys to create an account on stellar: the public key and the hidden key (secret seed).
- The public key, We have a public key that we can share with everyone. If someone wishes to give us Lumens, they must do so via this public key.
- And don’t tell anybody about the hidden key. This key is used to access the stellar account viewer. As a result, we must keep this key in a secure place.
We can create these keys both from the account viewer and from the code itself.
- If we want to create a key pair for a new account using account viewer, we must click on the Generate button and sign in with the Secret key as seen in the screenshot below, after which we can send lumens to another account and check the transaction history from the account viewer dashboard.
- If we want to build an account from the code, we must communicate with Horizon through libraries maintained by Stellar.org. These libraries are available in a variety of programming languages, including Java, JavaScript, Go, Python, Ruby, C#, and others.
- We must use the classes available in the given libraries when writing code. We may also use the code to enter the connection for making an account. First, we must produce public and private keys. And, to complete the transactions, we must use the test account in code when making an API call and pass the newly created public key. When we run the code for building an account, it will build and finance a new account with that public key as the account ID. We will be credited 10000.00 lumens, allowing us to conduct test payment transfers from one account to another. And in stellar, each account must have a minimum balance of one lumen.
Payments on stellar are sent and received
If we need to deliver the money, we must first make a transaction. We may conduct several operations in a single transaction, such as submitting orders, updating your address, or making deals to exchange different currencies. If every operation in the transaction fails, the whole transaction fails.
Any purchase incurs a small fee known as the base price. This fee prevents users from overburdening the system with many purchases.
We’ve already shown that we can make purchases using an account viewer. However, if we wish to do the payments by technology development, we must write the code in our preferred language. To receive the demo code, please visit this page.
If we wish to submit the bill, we must first.
- Mention the sender’s private key and the receiver’s public key.
- Create the contract by transferring the process form (such as Payment Operation), asset type (such as lumens), and sum to be transferred.
- We must define the type of asset we are sending—”native” Stellar’s currency is the lumen, but we can send whatever type of asset or currency we choose, from dollars to bitcoin to any type of asset.
- Send it to the stellar by uploading the transaction.
We don’t need to do anything to accept payments into a stellar account and once a payer completes a good transaction to send money, those assets will be immediately transferred to our account. We can verify the balance by visiting various URLs specified in the test URL, or we can check it by coding for different library types.