0

I want to lunch a clustering (procedure) algorithm in off_chain on data recorded in an IPFS. Input: my data, k: number of cluster or class Output: data clustered or labelled in class k

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

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

In other words:

I want to generate transactions, in these transactions I want to save my partitioned data(k cluster) in object if 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 sign all my transactions with one private key. Moreover in a smart contract I can’t generate external transactions?

How to solve the problem?

Cordially.

5
  • "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", why can't you do this?
    – Jay Welsh
    Jan 8, 2020 at 20:19
  • I suspect your ideas about data flow do not work with blockchain. We need to know more about what you want to accomplish and why use a blockchain. In particular, what do you need to prove and who needs to verify this proof? Jan 8, 2020 at 20:36
  • 4
    I'm voting to close this question as off-topic because as with your previous questions here, here and here, it completely lacks any focus on a specific technical problem, and you are essentially just asking others to implement your (extremely vague) specification. Jan 8, 2020 at 20:39
  • I just want to confirm if we can do that with the blockchain or not, I'm afraid to start implementing my algorithm and I don't respect the basic principles of blockchain. I explain the objective of my project: "toward a decentralized and confident IA through the blockchain" I took as an example an AI algorithm, machine learning in particular clustering (like Kmeans) and i want to implement it through a blockchain.
    – Kh Ya
    Jan 8, 2020 at 21:01
  • the miner will be rewarded for executing a clustering algorithm. when we say consensus we mean transaction. while my data is not transacted, it is in the IPFS, that's why I asked my question. how to save my data in transactions that are generated through a smart contract?
    – Kh Ya
    Jan 8, 2020 at 21:01

2 Answers 2

1

You will need to implement a smart contract using something like Solidity.

Please take a look at this if you would like a fairly easy way to learn the basics of Solidity: https://cryptozombies.io/

If the language itself allows you to properly handle and store the types of data in the ways that you need to, we would need to establish whether or not Ethereum itself properly facilitates the type of thing you would like to do.

Here are some key concepts to keep in mind working with Ethereum:

  • Storing large quantities of data is extremely costly (it is good that you are planning to store IPFS hashes as mappings to the actual data)
  • Ethereum currently processes ~ 15 tx/s (the entire network worldwide), it is, however, possible to wrap thousands of transactions into a single Ethereum transaction using zk-rollup technology, ZK Sync is a good example of this: https://matter-labs.io/
  • Each transaction on the root chain will cost a non-zero quantity of Ether.
  • Deployments are effectively permanent sets of functionality which are added to the Ethereum Virtual Machine, so try not to build anything dangerous because once it is there the only way it is coming off is by means of a hard fork.

Please provide an example of one item of a dataset that you would like to save to the Ethereum blockchain.

0

Please see my comment for suggestions to get a more informative answer.

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

You pass a signed transaction to a function that is designed to receive the data (arguments) and you store the values in contract state variables.

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

It's not clear that you need to unless a participant needs to be able to verify information another participant presents and/or the data in IPFS. A popular way to validate documents in IPFS is to store their hashes in a contract. Such a contract can also record the account that signed when the hash was first presented and it can limit access to authorized writers.

I can’t sign all my transactions with one private key

Yes. You can and you should sign all transactions from a given role or logical user with the same signing key. You use their address to authenticate users and addresses are usually the basis for access control.

I cannot generate several transactions in a unique smart contract

Actually, a single signed transaction can generate many things, or you can invert control and have a client iterate as needed. However, I would discourage storing the whole cluster details if that is what you have in mind. A single summary (32 bytes) should suffice. It depends on what you want to do which is not clear.

in a smart contract I can’t generate external transactions

No.

This doesn't mean your application isn't viable. Only that you have not adjusted to the way to think about blockchain designs. We can probably provide a hint but will we need to know what you need to accomplish to suggest better implementation details.

Hope it helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.