Creating a Raw Transaction

Introduction #

Raptoreum is a digital currency that operates on a decentralized, peer-to-peer network.
Transactions on the Raptoreum network are conducted through a blockchain,
a distributed ledger that records all transactions in a secure and transparent manner.

Raw transactions on the Raptoreum network are a way of creating and broadcasting transactions without relying on a third-party service or application.

To create raw transactions on the Raptoreum network, the following steps are involved:

  1. Understand the structure of Raptoreum transactions:
  • A typical Raptoreum transaction consists of inputs, outputs, and fees.
  • Inputs are the funds being spent in the transaction, while outputs are the recipients of those funds.
  • Fees are the amounts paid to miners to process the transaction.
  1. Identify the inputs, outputs, and fees of the transaction:
  • Inputs are typically derived from previous transactions.
  • Outputs are the Raptoreum addresses of the recipients.
  • The fee is calculated based on the size of the transaction and the current fee rate of the network.
  1. Construct a basic transaction:
  • Use the Raptoreum GUI wallet or CLI wallet to create the transaction.
  • In the GUI wallet, open the “Debug Console” under the “Tools” menu.
  • Use the “listunspent” command to list all the unspent outputs in your wallet.
  • Note down the transaction ID (txid) and output index (vout) of the output you want to spend in your raw transaction.
  • Use the “getnewaddress” command to generate a new address that you will send the funds to in your raw transaction.
  • Note down this address.
  • Use the “createrawtransaction” command to create a new raw transaction. This is the basic command:

createrawtransaction '[{"txid":"id","vout":n}]' '{"address":amount}

  • Replace <id> and <n> with the transaction ID and output index of the unspent output you want to spend, respectively.
  • Replace <address> with the address you generated with the “getnewaddress” command and <amount> with the amount you want to send to that address.
  1. Sign the transaction:
  • Use the “signrawtransactionwithwallet” command to sign your raw transaction.
  1. Broadcast the transaction:
  • Use the “sendrawtransaction” command to broadcast the signed transaction to the Raptoreum network.
  • Note down the transaction ID (txid) that is returned by the command.
  • You can use the “getrawtransaction” command to check the status of your transaction on the Raptoreum network.

 

Raw transaction commands and parameters #

In this section we will list all the commands and parameters available when constructing a Raptoreum raw transaction.

listunspent #

listunspent is a command in the Raptoreum network that allows users to get a list of unspent transaction outputs (UTXOs) for a given set of addresses. The command has several parameters that can be used to filter the results and provide more specific information.

Here are the explanations and examples for each parameter:

  • minconf: The minimum number of confirmations a transaction must have to be included in the results. By default, the value is set to 1. For example, to only include transactions with at least 6 confirmations, the command would be:

listunspent 6

  • maxconf: The maximum number of confirmations a transaction can have to be included in the results. By default, this value is set to 9999999, meaning all confirmations are included.
    For example, to only include transactions with no more than 3 confirmations, the command would be:

listunspent 0 3

  • addresses: A JavaScript Object Notation (JSON) array of addresses to filter the results by.
    Only UTXOs associated with these addresses will be returned. For example, to only include UTXOs associated with two specific addresses, the command would be:

listunspent 0 9999999 '["RgnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg",
"RgQQkwA4FYkq2XERzMY2CiAZhJTEDAbtcg"]'

  • include_unsafe: A boolean value indicating whether to include UTXOs from unconfirmed transactions. By default, this value is set to false. For example, to include UTXOs from unconfirmed transactions, the command would be:

listunspent 0 9999999 '[]' true

  • query_options: A JSON object containing additional query options. The available options are:
    • minimumAmount: The minimum value of the UTXOs to be included in the results. For example,
      to only include UTXOs with a value of at least 0.005 Raptoreum, the command would be:

listunspent 0 9999999 '[]' true '{ "minimumAmount": 0.005 }'

This command uses all the available parameters to only return UTXOs with at least 6 confirmations,
a minimum value of 0.005 Raptoreum, and includes UTXOs from unconfirmed transactions.
It also specifies an empty array for the addresses parameter, which means UTXOs from all addresses are included.
The command is authenticated using HTTP basic authentication with the username myusername.

getnewaddress #

The getnewaddress command in Raptoreum is used to generate a new address for receiving payments.
In this command, you can also specify a label for the new address that will be added to the address book.

Here’s a detailed explanation of how to use all the variables in getnewaddress, along with some examples:

The first argument to getnewaddress is an optional label that you can specify for the new address. If you provide a label, it will be associated with the address in the address book. This makes it easier to keep track of payments received with that address.

If you do not specify a label, the default label “” is used. This label does not need to exist in the address book and will be created if it does not already exist.

Here’s an example of using getnewaddress with a label:

getnewaddress "my label"

In this example, a new Raptoreum address will be generated and associated with the label “my label” in the address book.

The getnewaddress command returns the newly generated Raptoreum address as a string. Here’s an example:

RU4xkseZuV7ZGhhfBSuV7ZGhhfBvzGjEjK

createrawtransaction #

The createrawtransaction RPC command in Raptoreum allows you to create a new raw transaction
by specifying the inputs and outputs, without signing it or broadcasting
it to the network. The resulting raw transaction can then be passed to the signrawtransaction command for signing, and then to the sendrawtransaction command for broadcasting to the network.

The createrawtransaction command takes three arguments:

  1. inputs (array, required): An array of JSON objects representing the transaction inputs. Each input object should contain the following fields:
    • txid (string, required): The transaction ID of the input transaction.
    • vout (numeric, required): The output index of the input transaction that is being spent.
    • sequence (numeric, optional): The input sequence number. This is optional and defaults to 0xffffffff.

    For example, to create a raw transaction that spends two inputs with transaction IDs txid1 and txid2, and output indices 0 and 1 respectively, you would use the following inputs array:
    [ { "txid": "txid1", "vout": 0 }, { "txid": "txid2", "vout": 1 }]

  2. outputs (array, required): An array of JSON objects representing the transaction outputs. Each output object should contain one of the following two fields:
    • address (object, optional): A key-value pair, where the key is a Raptoreum address
      and the value is the amount of RTM to be sent to that address.
      The value can be either a float or a string.
    • data (object, optional): A key-value pair, where the key must be the string "data" and the value is a hex-encoded string representing the data to be embedded in the transaction.

    Additionally, there can only be one address containing future information, which is an address that contains a key-value pair with the following fields:

    • future_maturity (numeric, required): The number of confirmations required for the future transaction to become mature.
    • future_locktime (numeric, required): The total time in seconds from the first confirmation of the future transaction for it to become mature.
    • future_amount (numeric, required): The amount of RTM to be locked in the future transaction.

    For example, to create a raw transaction with two outputs, one sending 0.1 RTM to the address RTMaddress1, and another sending a data payload of 0x00010203 (in hex), you would use the following outputs array:
    [ { "address": { "RTMaddress1": 0.1 } }, { "data": "00010203" }]

  3. locktime (numeric, optional): The locktime of the transaction, in Unix timestamp or block height format.
    If non-zero, the locktime will activate the inputs of the transaction.
    If not specified, it defaults to 0.

Once you have specified the inputs, outputs, and locktime arguments, you can call the createrawtransaction command with those arguments to create the raw transaction. The command will return the resulting raw transaction as a hex-encoded string.

Examples:

  1. Sending 1 RTM to an address:

createrawtransaction "[{\"txid\":\"b21ef1f96aa39e7918d98c4f4e51fddcf29d9aa2cc85f20c
c0b45efb4a4a0664\",\"vout\":0}]" "[{\"address\":\"RTM9Nkh8tq3qAbqYKtG1JF96g8RnwDyfNV
\",\"amount\":1}]"

In this example, we are using the createrawtransaction command to create a transaction that spends the output of a previous transaction with the given txid and vout and sends 1 RTM to the address RTM9Nkh8tq3qAbqYKtG1JF96g8RnwDyfNV. The resulting raw transaction is returned as a hex-encoded string.

  1. Sending 2 RTM to an address with a locktime:

createrawtransaction "[{\"txid\":\"c3b5dfbf722a1f99c17dcf697ba3dbd82de0c929e69a3549d
91c09b82d81efc4\",\"vout\":0}]" "[{\"address\":\"RTM9Nkh8tq3qAbqYKtG1JF96g8RnwDyfNV\
",\"amount\":2,\"future\":{\"future_maturity\":6,\"future_locktime\":86400,
\"future_amount\":3}}]" 123456


In this example, we are creating a transaction that spends the output of a previous transaction with the given txid and vout and sends 2 RTM to the address RTM9Nkh8tq3qAbqYKtG1JF96g8RnwDyfNV. We also specify a locktime of 123456. Additionally, we specify a future output with future_maturity of 6 confirmations, future_locktime of 86400 seconds (1 day), and a future_amount of 3 RTM. This means that the future_amount of 3 RTM will be locked until either 6 confirmations have been reached or
1 day has passed since the first confirmation of the transaction.
The resulting raw transaction is returned as a hex-encoded string.

  1. Sending data to an address

createrawtransaction "[{\"txid\":\"18d31b6f5a1dc5c6b0d6f50502c55b16fa6728532357e5da5d
51df1b2dc3a3f7\",\"vout\":0}]" "[{\"data\":\"48656c6c6f20526170746f7265756d\"},{\"address\":
\"RTM9Nkh8tq3qAbqYKtG1JF96g8RnwDyfNV\",\"amount\":0.001}]"

In this example, we are creating a transaction that spends the output of a previous transaction with the given txid and vout and includes two outputs. The first output is a data output with the hex-encoded string 48656c6c6f20526170746f7265756d, which decodes to the string Hello Raptoreum. The second output sends 0.001 RTM to the address `RTM9Nkh8tq3qAbqYKtG

 

Example:

Let’s create a raw transaction that spends an input with txid 7b61c6d88a7c3e6c3a56e225f772b55d6bce5e0e5b5c77d02f0e5d0c33f91ef4 and vout 0, sending 1.5
RTM to the address RU6NVaUeJNNe7VJhDdopx7VwGjUNhJ4ndG.

createrawtransaction "[{\"txid\":\"7b61c6d88a7c3e6c3a56e225f772b55d6bce5e0e5b5c77d
02f0e5d0c33f91ef4\",\"vout\":0}]" "[{\"RU6NVaUeJNNe7VJhDdopx7VwGjUNhJ4ndG\":1.5}]"

This command will return a hex-encoded raw transaction, which can be used as input for the signrawtransactionwithwallet command to sign the transaction with the private key of the inputs’ addresses.

Let’s break down the arguments of the createrawtransaction command and understand what each one does:

  1. inputs: This is an array of JSON objects that represent the inputs of the transaction. Each object must contain three fields:
  • txid: The transaction ID of the input.
  • vout: The index of the output in the previous transaction.
  • sequence: An optional field indicating the sequence number. This is usually set to 0xffffffff and can be used to enable replacement of a transaction that is stuck in the mempool.

In our example, we have only one input object, representing an input with txid 7b61c6d88a7c3e6c3a56e225f772b55d6bce5e0e5b5c77d02f0e5d0c33f91ef4 and vout 0. We did not include the sequence field.

  1. outputs: This is an array of JSON objects that represent the outputs of the transaction. Each object can have one of two fields:
  • address: The Raptoreum address that receives the output.
  • data: An optional field containing arbitrary data encoded in hexadecimal format.

In our example, we have only one output object, which contains the address field with value RU6NVaUeJNNe7VJhDdopx7VwGjUNhJ4ndG and the amount field with value 1.5. This will create an output that sends 1.5 RTM to the address RU6NVaUeJNNe7VJhDdopx7VwGjUNhJ4ndG.

  1. locktime: An optional field indicating the locktime of the transaction. This is usually set to 0, which means the transaction can be included in the next block.
    If set to a non-zero value, it indicates the earliest time or block
    height at which the transaction can be included in a block.

In our example, we did not set the locktime field, so it defaults to 0.

With these arguments, the createrawtransaction command constructs a transaction with the specified inputs and outputs and returns its hex-encoded representation.

It’s worth noting that the resulting transaction is not signed,
and it is not stored in the wallet or transmitted to the network.
To sign and broadcast the transaction, you need to use additional commands such as

 signrawtransactionwithwallet and sendrawtransaction.

 

locktime.

locktime is an optional parameter that sets the transaction’s locktime. If set to 0 (default), the transaction is not locked and can be included in the next block.
If set to a non-zero value, the transaction is locked until the block with the
given height or timestamp is reached. If the value is less than 500 million,
it’s interpreted as a block height; otherwise, it’s interpreted as a Unix timestamp.

Here’s an example of using the locktime parameter:

createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"address\":0.01}]" 123456

In this example, the transaction is locked until the block with height 123456 is reached.

 

signrawtransactionwithwallet #

signrawtransaction has been deprecated, we are now using signrawtransactionwithwallet

The signrawtransactionwithwallet command in Raptoreum allows you to sign inputs for a raw transaction with private keys from your wallet.
It takes two optional arguments: the first is the hex-encoded raw transaction you want to sign,
and the second is an array of previous transaction outputs that this transaction depends on
but may not yet be in the blockchain. Here is a detailed explanation of the arguments:

  1. hexstring” (string, required): The hex-encoded raw transaction you want to sign. You can create this using the createrawtransaction command. The transaction must have one or more inputs that reference unspent outputs (UTXOs) from previous transactions.
  2. prevtxs” (string, optional): An array of previous transaction outputs that this
    transaction depends on but may not yet be in the blockchain. Each object in the
    array should contain the following fields:
  • txid” (string, required): The transaction ID of the previous transaction output.
  • vout” (numeric, required): The output index of the previous transaction output.
  • scriptPubKey” (string, required): The public key script of the previous transaction output.
  • redeemScript” (string, optional): The redeem script of the previous transaction output. This is required only for P2SH scripts.
  • amount” (numeric, required): The amount spent in the previous transaction output.

You can provide multiple objects in the array to reference multiple previous transaction outputs.
If you don’t provide this argument, Raptoreum will attempt to find the previous transaction
outputs in the blockchain.

  1. sighashtype” (string, optional, default=ALL): The signature hash type.
    This determines which parts of the transaction are covered by the signature.
    The possible values are:
  • ALL“: Sign all of the inputs and outputs.
  • NONE“: Sign none of the inputs and outputs.
  • SINGLE“: Sign only the input corresponding to the current output index (for outputs with index less than the current).
  • ALL|ANYONECANPAY“: Sign all of the inputs, but only the current output.
  • NONE|ANYONECANPAY“: Sign none of the inputs, but only the current output.
  • SINGLE|ANYONECANPAY“: Sign only the input corresponding to the current output index
    (for outputs with index less than the current), but only the current output.

The default value is “ALL”, which signs all inputs and outputs.

 

The result of the signrawtransactionwithwallet command is a JSON object with the following fields:

  • hex” (string): The hex-encoded raw transaction with signature(s).
    If all inputs have been successfully signed, this will be a
    complete transaction that you can broadcast to the network
    using the sendrawtransaction command.
  • complete” (boolean): Indicates whether all inputs have been successfully signed.
    If this is true, the “hex” field will contain a complete transaction that you
    can broadcast to the network.
    If this is false, some inputs may still need to be signed.
  • errors” (array of objects, optional): An array of script verification errors (if there are any). Each object in the array contains the following fields:
    • txid” (string): The hash of the referenced, previous transaction.
    • vout” (numeric): The index of the output to spent and used as input.
    • scriptSig” (string): The hex-encoded signature script.
    • sequence” (numeric): The script sequence number.
    • error” (string): A verification or signing error related to the input.

Here is an example of how to use the signrawtransactionwithwallet:

signrawtransactionwithwallet "0100000001f02c521662fa5a5b5e9b0d7e8e776d82e83332
a6360f2d0b8cebcf59f03f0c9a000000006b483045022100a29cc29142c3e38f7d8aa0c222068e1
c2809b61e53b8178a86815d163958656c02202d3a3e8b4e2adad74ef6b2d7f98f392d798f79b841
e1761b71bc33e8c64e22a012102c2909c841757e6e57d1eabec6da252c6ea3c4c4f7b4472a9c748
a0f2bfa2868fffffffff0200e1f505000000001976a914d9e8e3ccf97499e2b57781f63e06dcfcb
74a4b2c88ac680002d687df00001976a91436dc6a632c7e28b6d3f7a424a6ab338c7fa1d9cb88ac
00000000" '[{"txid":"9a0c3ff059cfceb8d0f26036a63233e8826d778e7e0d9b5e5a5afa6215
222cf0","vout":0,"scriptPubKey":"76a91436dc6a632c7e28b6d3f7a424a6ab338c7fa1d9cb
88ac","redeemScript":"","amount":0.00010000}]' "ALL"

In this example, the first argument is the serialized, hex-encoded transaction that we want to sign.
The second argument is an array of JSON objects containing information about the previous
transaction output that the current transaction depends on.
In this case, we are specifying the transaction ID, output index, script public key,
and redeem script for the previous transaction output.
The third argument is the signature hash type, which is set to “ALL” in this example.

The command will return a JSON object with the signed transaction in hex format,
a boolean value indicating whether the transaction has a complete set of signatures,
and an array of script verification errors (if any).

 

decoderawtransaction #

decoderawtransaction is a command in the Raptoreum Core wallet that allows you to decode a raw transaction
in hexadecimal format into a JSON object. The resulting JSON object contains information about the
transaction such as inputs, outputs, and scriptPubKeys.

decoderawtransaction “hexstring”

Returns a JSON object representing the serialized, hex-encoded transaction.

Arguments:
1. “hexstring” (string, required) The transaction hex string

Result:
{
“txid” : “id”, (string) The transaction id
“size” : n, (numeric) The transaction size
“version” : n, (numeric) The version
“type” : n, (numeric) The type
“locktime” : ttt, (numeric) The lock time
“vin” : [ (array of json objects)
{
“txid”: “id”, (string) The transaction id
“vout”: n, (numeric) The output number
“scriptSig”: { (json object) The script
“asm”: “asm”, (string) asm
“hex”: “hex” (string) hex
},
“sequence”: n (numeric) The script sequence number
}
,…
],
“vout” : [ (array of json objects)
{
“value” : x.xxx, (numeric) The value in RTM
“n” : n, (numeric) index
“scriptPubKey” : { (json object)
“asm” : “asm”, (string) the asm
“hex” : “hex”, (string) the hex
“reqSigs” : n, (numeric) The required sigs
“type” : “pubkeyhash”, (string) The type, eg ‘pubkeyhash’
“addresses” : [ (json array of string)
“RHWpdKbEP1e3jtgqeByfEAkMUaMdtC3fF9” (string) Raptoreum address
,…
]
}
}
,…
],
“extraPayloadSize” : n (numeric) Size of DIP2 extra payload. Only present if it’s a special TX
“extraPayload” : “hex” (string) Hex encoded DIP2 extra payload data. Only present if it’s a special TX
}

 

 

sendrawtransaction #

The sendrawtransaction command is used to submit a raw transaction in hex format to the Raptoreum network. This transaction should be created using the createrawtransaction command and signed using the signrawtransaction command. The sendrawtransaction command then broadcasts the signed transaction to the network.

Here are the details of each argument:

  1. hexstring” (string, required): This is the hex string of the raw transaction that needs to be broadcasted.
    The hex string should be obtained by using the createrawtransaction command.
  2. allowhighfees (boolean, optional, default=false): This argument is used to allow high fees for the transaction. By default, this value is set to false.
    If you set it to true, it allows the transaction to have a higher fee than what is normally allowed.
  3. instantsend (boolean, optional, default=false): This argument is deprecated and ignored. You do not need to use this argument.
  4. bypasslimits (boolean, optional, default=false): This argument is used to bypass transaction policy limits.
    By default, this value is set to false.
    If you set it to true, it allows the transaction to bypass the policy limits that are set on the node.

 

Now, let’s look at some examples of how to use the sendrawtransaction command:

Example 1: Sending a transaction with default arguments

Suppose you have created a raw transaction using the createrawtransaction command and signed it using the signrawtransaction command. The signed transaction is in hex format and stored in a variable called signed_hex. To broadcast this transaction to the Raptoreum network, you can use the following command:

sendrawtransaction "signed_hex"

This command will send the signed transaction to the Raptoreum network with default arguments.

Example 2: Allowing high fees for the transaction

Suppose you want to send a transaction with a higher fee than what is normally allowed. You can use the allowhighfees argument to allow this. To do this, you can use the following command:

sendrawtransaction "signed_hex" true

This command will send the signed transaction to the Raptoreum network and allow high fees for the transaction.

Example 3: Bypassing transaction policy limits

Suppose you want to send a transaction that exceeds the policy limits set on the node. You can use the bypasslimits argument to bypass these limits. To do this, you can use the following command:

sendrawtransaction "signed_hex" false false true

This command will send the signed transaction to the Raptoreum network and bypass the policy limits set on the node.

 

Actual Raw Transaction on the Raptoreum Blockchain #

Lets make an actual Raw Transaction on the Raptoreum Blockchain,

  1. listunspent:

We will use this UTXO for our transaction,

{

“txid”: “304c62f7516e7513885495c50f02d5d871c124c939bf2cf360ed64a25086074c”,

“vout”: 0,

“address”: “RHWpdKbEP1e3jtgqeByfEAkMUaMdtC3fF9”,

“label”: “”,

“scriptPubKey”: “76a9145a54ec3d843a5cc388c94533e677ecde38f784c588ac”,

“amount”: 2.00000000,

“confirmations”: 2015,

“spendable”: true,

“solvable”: true,

“future”: false,

“futureSpendable”: true,

“safe”: true,

“coinjoin_rounds”: -2

},

2) getnewaddress

RLTaPgx8PC71ARV9SLQ8aN5UGcyuyGDDk9

3) createrawtransaction:

createrawtransaction '[{"txid":"304c62f7516e7513885495c50f02d5d871c124c939bf2cf360ed64a
25086074c","vout":0}]' '{"RLTaPgx8PC71ARV9SLQ8aN5UGcyuyGDDk9":1.9}'

output of creatrawtransaction:

02000000014c078650a264ed60f32cbf39c924c171d8d5020fc595548813756e51f7624c300000000000ffffffff0

1802b530b000000001976a9147aa02b62bbbe8d388626562421370e4db45af2e988ac00000000

4) decoderawtransaction:

decoderawtransaction 02000000014c078650a264ed60f32cbf39c924c171d8d5020fc595548813756e
51f7624c300000000000ffffffff01802b530b000000001976a9147aa02b62bbbe8d388626562421370e4d
b45af2e988ac00000000

Output from decoderawtransaction,

{
"txid": "72c74b6769e2a7696a098bbc59a5c60c6cbd03981933c9b1d52bff0cfc00b7f6",
"version": 2,
"type": 0,
"size": 85,
"locktime": 0,
"vin": [
{
"txid": "304c62f7516e7513885495c50f02d5d871c124c939bf2cf360ed64a25086074c",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 1.90000000,
"valueSat": 190000000,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 7aa02b62bbbe8d388626562421370e4db45af2e9 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a9147aa02b62bbbe8d388626562421370e4db45af2e988ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"RLTaPgx8PC71ARV9SLQ8aN5UGcyuyGDDk9"
]
}
}
]
}

5) signrawtransactionwithwallet:

signrawtransactionwithwallet 02000000014c078650a264ed60f32cbf39c924c171d8d5020fc5955
48813756e51f7624c300000000000ffffffff01802b530b000000001976a9147aa02b62bbbe8d38862656
2421370e4db45af2e988ac00000000

Output from signrawtransactionwithwallet:

{ "hex":
"02000000014c078650a264ed60f32cbf39c924c171d8d5020fc595548813756e51f7624c30000000006b483045022100e00091f137a1a917d4ae967a7ebd52a26a1170cf8133fb78788510607a9e2b8a02201458c3e58cba4c896e080591f12e6549edeb3cee023c0dee426d0b73ad2f8c460121020ba50bc5829ac515cfb30f8d9ea7140c8fb340fd09c52ec714fe93c844753cb2ffffffff01802b530b000000001976a9147aa02b62bbbe8d388626562421370e4db45af2e988ac00000000",
"complete": true }

6) sendrawtransaction:

sendrawtransaction "02000000014c078650a264ed60f32cbf39c924c171d8d5020fc595548813756e51f
7624c30000000006b483045022100e00091f137a1a917d4ae967a7ebd52a26a1170cf8133fb78788510607a9
e2b8a02201458c3e58cba4c896e080591f12e6549edeb3cee023c0dee426d0b73ad2f8c460121020ba50bc58
29ac515cfb30f8d9ea7140c8fb340fd09c52ec714fe93c844753cb2ffffffff01802b530b000000001976a91
47aa02b62bbbe8d388626562421370e4db45af2e988ac00000000"

txid received from sendrawtransaction:

45a4c6c3f3a5e137265c2128f6a1e25ffaae558eb9b722561f76c8b586baf294

This sequence of events demonstrates how to create and send a raw transaction on the Raptoreum network. Here’s a brief explanation of each step:

listunspent: This command lists all unspent transaction outputs (UTXOs) associated with the specified wallet address.
In this case, it returns a UTXO with an ID of
304c62f7516e7513885495c50f02d5d871c124c939bf2cf360ed64a25086074c
and a value of 2 Raptoreum (RTM).

getnewaddress: This command generates a new Raptoreum address that can be used to receive funds.
In this example, the new address is RLTaPgx8PC71ARV9SLQ8aN5UGcyuyGDDk9.

createrawtransaction: This command creates a raw transaction that spends the UTXO from step 1 and
sends 1.9 RTM to the new address generated in step 2. The output of this
command is a hexadecimal string that represents the unsigned transaction.

decoderawtransaction: This command decodes the unsigned transaction created in step 3 to verify that it is correct.
The output shows the transaction ID, version, type, size, lock time, and input and output details.

signrawtransactionwithwallet: This command signs the unsigned transaction created in step 3 with the private keys
associated with the wallet.
The output is a hexadecimal string that represents the signed transaction.

sendrawtransaction:

This command broadcasts the signed transaction created in step 5 to the Raptoreum network.
The output is the transaction ID of the broadcasted transaction.

Overall, this sequence of events demonstrates how to create and send a simple transaction
on the Raptoreum network using the command line interface.

Conclusion #

In this paper, we have covered the steps required to create raw transactions on the Raptoreum network using the RPC console.
By following these steps, you can create and broadcast your own custom transactions on the
Raptoreum network, without the need for a wallet or third-party software.

Creating raw transactions on the Raptoreum network is a useful skill for advanced users and developers
who want to build decentralized applications or wallets. Raw transactions allow us to
create and broadcast transactions without relying on a third-party service or application.

It is important to note that creating and broadcasting raw transactions can be risky,
as any mistakes can result in the loss of funds. Therefore,
it is recommended that you practice with small amounts of Raptoreum
before attempting to create and broadcast larger transactions.

We hope that this guide has been helpful in understanding the process of
creating raw transactions on the Raptoreum network using the RPC console.
If you have any further questions, feel free to consult the Raptoreum documentation or community resources.

This document was written by “Longhorn” and a bounty claimed.