Skip to content

TransactionCrafting

Steven Masley edited this page Jan 10, 2020 · 1 revision

How to craft a Pegnet transaction

If you are using the API instead of the CLI, you will have to craft transactions yourself. The API does not have any functions to craft transactions. This requires implementation by the developer.

A Pegnet transaction requires creating and submitting a Factom entry into the Factom chain cffce0f409ebba4ed236d49d89c70e4bd1f1367d86402a3363366683265a242d. If you unfamiliar with a Factom Entry and how to submit one, please review the Hello World examples on the FactomProtocol documentation site.

The Factom Entry

A factom entry consists of two components. The ExtIDs and the content. For a pegnet transaction, the content is simply json, and the format can be found here in the wiki. This part should be somewhat straight forward and cover transactions and conversions.

What is lacking from the content is the signatures. The signatures are included in the ExtIDs according to the FAT-103 standard which can be viewed here. Pegnet adheres to the Factom-Asset-Token standards for easier compatibilitiy. The FAT 103 reference library exists in GoLang and is located here.

If you are going to craft a transfer or conversion, you must implement both parts of the transaction standard. Libraries will likely be developed to ease this process.

Examples

If you have any other examples, please reach out so we can add them to this wiki!