DEV Community

Cover image for Stellar Quests Level 1: Change Trust
WZRD
WZRD

Posted on

Stellar Quests Level 1: Change Trust

What are Trustlines?

A trustline, on the Stellar blockchain, is an one way agreement between two accounts. The source account that's making the agreement decides to trust another account. The trust is based on a custom asset (ex. "$ROCK") where Account-A decides that they would like to hold/sell/trade the custom asset issued by Account-B because they believe it to be of value. NOTE: Custom assets are never actually created- they only exist in the form of trust on other accounts; I'll cover this concept more in depth in a future blog post.

How are Trustlines created?

Trustlines are created by building a transaction of operation type "Change Trust". This operation asks for three inputs: asset, trust limit, and source account. The Asset is the custom asset one decides to trust; this field requires the asset code (ex. ROCK) and the issuer account id (public key of the account that issued the custom asset). The Trust Limit is a number that represents the max amount of units, of a custom asset, that you're willing to trust; if set to 1,000, then the account creating the trustline will only be able to hold 1,000 units of the custom asset. The Source Account is the public key of the account that'll be creating the trustline; this input is optional because if the trustline won't be created by the account which has built the transaction, then the public key entered here will refer to the account that will create the trustline. NOTE: All transactions MUST be signed off by all source accounts mentioned; in this case, the account which built the transaction and the account which is actually creating
the trustline.

I plan on writing corresponding blog posts with relevant code examples. For now, I'm simply learning the basics of the Stellar blockchain and utilizing the Stellar Laboratory in order to interact with the test net. If you wish to learn about the Stellar blockchain, and earn while doing it, then please visit: https://quest.stellar.org/

Top comments (0)