BlockchainTransaction (for Cardano)

BlockchainTransaction[assoc]

represents a Cardano blockchain transaction built from the components in the association assoc.

Details

  • Gives a symbolic representation of a Cardano blockchain transaction; it does not submit the transaction, and the transaction is not signed.
  • BlockchainTransaction[][prop] gives the value of the property prop for the transaction.
  • The following elements must be given:
  • "Inputs"list of inputs, given as associations
    "Outputs"list of outputs, given as associations
  • The following additional elements can also be given:
  • "Fee"Automatictransaction fee
    "TimeToLive"Noneupper-bound slot number for the transaction to be valid
    "Mint"Nonelist of tokens to be minted
    "Scripts"Nonepolicy scripts
    "Metadata"Nonemetadata of tokens to be minted
  • Each association in the "Inputs" list must have the following entries:
  • "TransactionID"hash of a previous transaction
    "Index"index within the previous transaction output
  • Each association in the "Outputs" list must have the following entries:
  • "Address"hash of a previous transaction
    "Amount"amount in lovelace
  • The following additional entry can also be given:
  • "Tokens"list of input tokens
  • Each association in the "Tokens" list must have the following entries:
  • "AssetName"asset name as a hex string
    "PolicyID"policy ID
    "Quantity"amount of tokens
  • Each association in the "Mint" list must have the following entries:
  • "AssetName"asset name given as a hex string
    "PolicyID"policy ID
    "Quantity"amount of tokens to be minted (burned if quantity is a negative number)
  • BlockchainTransaction can represent Cardano mainnet and testnet transactions. To specify these networks, use the "BlockchainBase" value inside the required association or the BlockchainBase option.

Examples

open allclose all

Basic Examples  (1)

Create a Cardano transaction object to transfer ada cryptocurrency:

Create a Cardano transaction object to transfer ada and tokens:

Scope  (5)

Default Values  (2)

If not specified using the "Fee" element, the transaction fee will be automatically computed:

If not specified using the "TimeToLive" element, the transaction will not include a time to live (TTL) slot number:

Minting and Burning Tokens  (2)

Mint tokens by using the "Mint" and "Scripts" elements:

Burn tokens by using a negative integer in the "Quantity" element of the associations used by the "Mint" field:

Metadata  (1)

Create metadata for a transaction.

The structure of the metadata should be compatible with a JSON file:

Use the "Metadata" element to include the transaction metadata:

Options  (2)

BlockchainBase  (2)

Mainnet  (1)

Create a mainnet transaction:

Testnet  (1)

Create a testnet transaction:

Applications  (5)

Create a Cardano blockchain transaction to transfer ada cryptocurrency:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

Create a Cardano blockchain transaction to transfer tokens:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

Create a Cardano blockchain transaction to mint 1,000,000 tokens and send them to multiple addresses:

Sign the transaction with PrivateKey objects:

Submit the transaction to the Cardano blockchain to mint the tokens:

Verify the transaction using its "TransactionID":

Generate an image to mint it as an NFT:

Upload the image to IPFS and save its CID:

Prepare the NFT metadata following the CIP 25 standard:

Create the Cardano blockchain transaction to mint the NFT:

Sign the transaction with PrivateKey objects:

Submit the transaction to the Cardano blockchain to mint the NFT:

Verify the transaction using its "TransactionID":

Create a Cardano blockchain transaction to burn tokens:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

Properties & Relations  (1)

An element of the "UTXOList" property of BlockchainAddressData can be used as an input in a Cardano blockchain transaction:

Wolfram Research (2021), BlockchainTransaction, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Cardano.html.

Text

Wolfram Research (2021), BlockchainTransaction, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Cardano.html.

CMS

Wolfram Language. 2021. "BlockchainTransaction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Cardano.html.

APA

Wolfram Language. (2021). BlockchainTransaction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Cardano.html

BibTeX

@misc{reference.wolfram_2022_blockchaintransaction, author="Wolfram Research", title="{BlockchainTransaction}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Cardano.html}", note=[Accessed: 12-August-2022 ]}

BibLaTeX

@online{reference.wolfram_2022_blockchaintransaction, organization={Wolfram Research}, title={BlockchainTransaction}, year={2021}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransaction-Cardano.html}, note=[Accessed: 12-August-2022 ]}