Save data in transaction generated through a smart contract

I want to lunch a custering (procedure) algorithm in off_chain on data recorded in an IPFS.

Input : my data, k: number of cluster or class
Output : data clustered or lableed in class k

  • List item

How to save the output in a blockchain (on-chain) throug a transactions ?

  • List item

How to include the On-chain blockchain in all this through transactions?

In other word:

I want to generate transactions, in these transactions I want to save my partitioned data(k cluster) in objectif to lunch a consensus protocol?

the problem is that ,I cannot generate several transactions in a unique smart contract because i have only a single private key and i can’t signe all my transactions with one private key moreover in a smart contract i can’t generate an external transactions !!

how to solve the problem


1 Like

Hi @Khenfouci_Yamina,

I am not sure what you mean by not being able to sign transactions with one private key? It might help if you could describe the process flow in more detail.

As you have said, only externally owned accounts can initiate transactions.
Though a third party could be used to initiate a transaction. (An example in DeFi is Scheduled Dapp Interactions - time based first, anything else will follow).

To start playing with smart contracts you could use a simple contract that currently stores just one value. Remix can be used as a playground.


pragma solidity ^0.5.0;

contract Box {
    uint256 private value;

    // Emitted when the stored value changes
    event ValueChanged(uint256 newValue);

    // Stores a new value in the contract
    function store(uint256 newValue) public {
        value = newValue;
        emit ValueChanged(newValue);

    // Reads the last stored value
    function retrieve() public view returns (uint256) {
        return value;