BlockchainTransactionSign (for Cardano)

BlockchainTransactionSign[obj,key]

digitally signs a Cardano blockchain transaction using the specified private key.

BlockchainTransactionSign[obj,{key1,key2,}]

digitally signs a transaction using all the keys keyi.

Details

Examples

open allclose all

Basic Examples  (1)

Create a Cardano blockchain transaction:

Sign the transaction with a PrivateKey object:

Scope  (1)

Multiple Key Signatures  (1)

Sign a Cardano transaction with multiple keys. Each key corresponds to one input:

Applications  (11)

Transfer Cryptocurrency  (1)

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":

Mint Tokens  (1)

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

Alternatively, a single output is allowed to have "Amount" set to Automatic to have any remaining tokens sent to that address:

Sign the transaction with PrivateKey objects:

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

Verify the transaction using its "TransactionID":

Mint NFT  (1)

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":

Transfer Tokens  (1)

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":

Burn Tokens  (1)

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":

Deploy Compiled Plutus Script  (1)

Obtain a compiled Plutus script:

This particular script succeeds if, and only if, the redeemer's script data is a list of prime factors of the datum. For the datum, choose 221 as an arbitrary semi-prime. Script data must conform to Cardano's detailed JSON schema:

Deploy Plutus scripts with a datum hash by specifying within the "Outputs" list an "Address" pointing to a script file and a "Datum" with "Data" pointing to a script data file and using the "Hash" mode:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

Spend Compiled Plutus Script  (1)

Spend a Plutus script using the "Redeemer", "Datum" and "Script" elements in the "Inputs" list and specifying collateral inputs in "CollateralInputs":

Notice that execution units were calculated automatically:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

Spend Compiled Plutus Script with Required Signers  (1)

Obtain a compiled Plutus script:

This particular script succeeds if, and only if, the spending transaction is signed by the private key associated with the public key hash included in the deployed datum:

Deploy a Plutus script with a datum hash by specifying within the "Outputs" list an "Address" pointing to a script file and a "Datum" with "Data" pointing to a script data file and using the "Hash" mode:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain:

Spend Plutus scripts that have required signers by specifying them with a PrivateKey object, a PublicKey object, an address or a public key hash within the "RequiredSigners" list:

When automatic execution units are requested and the script requires signers, calculation of required signers is delayed until the transaction is signed. Sign the transaction using a PrivateKey object:

The automatic execution units have now been calculated:

Submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

Deploy and Spend Plutus Script V2 with a ReferenceScript and CollateralOutputs  (3)

Deploy Reference Script  (1)

Obtain a compiled Plutus V2 script:

Create a Cardano blockchain transaction to deploy a reference script:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain to deploy reference script:

Verify the transaction using its "TransactionID":

Deploy Plutus Script UTXO with Inline Datum  (1)

Create a Cardano blockchain transaction to deploy a script UTXO:

Sign the transaction with a PrivateKey object:

Submit the transaction to the Cardano blockchain to deploy the script UTXO:

Verify the transaction using its "TransactionID":

Spend Plutus Script  (1)

The following transaction that holds tokens will be used as collateral:

Create a Cardano blockchain transaction to spend a script UTXO using reference script and collateral outputs:

Sign the transaction with a PrivateKey object and submit the transaction to the Cardano blockchain:

Verify the transaction using its "TransactionID":

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2024_blockchaintransactionsign, author="Wolfram Research", title="{BlockchainTransactionSign}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Cardano.html}", note=[Accessed: 09-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_blockchaintransactionsign, organization={Wolfram Research}, title={BlockchainTransactionSign}, year={2021}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainTransactionSign-Cardano.html}, note=[Accessed: 09-October-2024 ]}