How a number of blockchain users save their data in the blockchain network using ethereum. Meaning more than one user sends his data using Python to save it in blockchain networl ?? How do I distinguish this data from this user or from another user? i am using ethereum virtual machine
1 Answer
You used the tags "solidity" and "contract-development" so I assume your question is from a code point of view.
The smart contracts use a data structure called "mapping" to save data to the Blockchain. An exemple of mapping declaration in Solidity can be :
mapping( address => uint256) userBalances;
This is a kind of dictionary with the first parameter being the key and the second the value.
That's how you link data to users in Ethereum.
-
I have a group of blockchain users, how can I distinguish that data comes from a specific user? My question is how do I represent users ???– esraaJul 4, 2020 at 17:00
-
Intercept the transactions and get the senders' addresses. Users are defined by their Ethereum address.– clementJul 4, 2020 at 17:11
-
In Python, how do I specify the address for each transaction? I am really sorry, I am a beginner in Ether– esraaJul 4, 2020 at 17:30
-
You would need some kind of library to interact with contracts, like pypi.org/project/ethereum Jul 4, 2020 at 19:45