I am trying to send a full block with a transaction payload to the Shimmer Testnet through this endpoint.
The payload has a transaction essence with one UTXO Input and creates a Basic Output.
The Basic Output has a sender feature.
The resulting block I want to send to the nodes by using this API is the following:
{
"nonce": "1152921504607082870",
"parents": [
"0x0ac1a4bc67f3e8a71f3881848c194826bb37f23d88dacacd47060b54a8ffcf19",
"0x0fae8083fbfbd805cc1dc6af91ce92fb93dc7f4927539e63e1a1a376eda96366",
"0x39035c1a906316d75f85e497d74408568e540830c0a18b52a4e194243c1e94ca",
"0x3d75eb67753a09efc13f09c9f046c7c5ab5c01cadc271a4f7f6582338be196a6"
],
"payload": {
"essence": {
"inputs": [
{
"transactionId": "0xec32fd61e28428cecccb20a3e6e9d01799d35df394b5e5a23232bc6d5a62b12f",
"transactionOutputIndex": 0,
"type": 0
}
],
"inputsCommitment": "0x43b14fb15642a8df580a30a268245cde078013c377ed676fbcff49afd70266e5",
"networkId": "8342982141227064571",
"outputs": [
{
"amount": "1000000000",
"features": [
{
"sender": {
"pubKeyHash": "0x67149b47cd37eeb72a6a67bf6550160282ba06d99529638347359a3eeeb77afa",
"type": 0
},
"type": 0
}
],
"type": 3,
"unlockConditions": [
{
"address": {
"pubKeyHash": "0x67149b47cd37eeb72a6a67bf6550160282ba06d99529638347359a3eeeb77afa",
"type": 0
},
"type": 0
}
]
}
],
"payload": null,
"type": 1
},
"type": 6,
"unlocks": [
{
"signature": {
"publicKey": "0x737ed27947376bc4b2db80392b3ca0fab5519ed94ca130cb9e340c2550aa125d",
"signature": "0xbe37c449614ebf7025a50a442ed7ae347f19f2d5ef73768c1559d370366e5d37a4584b2e5bf66c3398a99babe91aef7e517d652d64e081d84003784063bec604",
"type": 0
},
"type": 0
}
]
},
"protocolVersion": 2
}
So I want to create and output of 1000 smr by consuming an input that holds that amount of smr. The output to be created has to be unlocked with the same keys that the consumed input. My intention is to store some custom metadata in the generated output.
The problem is that when i send this block to the node the node return error 500 with message
"internal server error. error: runtime error: invalid memory address or nil pointer dereference".
I have been able to send Tagged data payloads and fulfill PoW. Also I have been able to send a Transaction payload with metadata and tag features. This error only happens when adding a sender feature. If someone knows what it is wrong with this procedure and block please let me know. Thank you for your time.
More on the procedure:
"parents" are obtained by /api/core/v2/tips
"transactionId" and "transactionOutputIndex" are obtained by /api/indexer/v1/outputs/basic?address=rms1qpn3fx68e5m7ade2dfnm7e2szcpg9wsxmx2jjcurgu6e50hwkaa054gcnwt and then api/core/v2/outputs/0xec32fd61e28428cecccb20a3e6e9d01799d35df394b5e5a23232bc6d5a62b12f0000
"inputsCommitment" is the result of serializing the "output" field from api/core/v2/outputs/0xec32fd61e28428cecccb20a3e6e9d01799d35df394b5e5a23232bc6d5a62b12f0000 and getting the hash by Blake2b_256. You need to hash twice
"signature" is the ed25519 signature of the Blake2b_256 hash of the serialized essence using the keypairs from the address rms1qpn3fx68e5m7ade2dfnm7e2szcpg9wsxmx2jjcurgu6e50hwkaa054gcnwt.
"networkId" is the first 8 bytes of the Blake2b_256 hash of "testnet"
"nonce" is calculated to produce a curlp81 hash with more than 13 zeros to get a pow score greater than 1500