Solidity: Code to hide message sender address (msg.sender) when writing on a contract

0 votes
Solidity: Code to hide message sender address (msg.sender) when writing on a contract

Is it possible to hide message sender (msg.sender) address when writing to a contract to pick any other number like a number 1.

Kindly assist.

Kind Regards,
Sep 14 in Blockchain by Wilson
• 140 points
137 views

1 answer to this question.

0 votes

Hey @Wilson,

You can use a smart contract as an agreement between a seller and a buyer when planning a remote purchase.

The main idea is that both seller and buyer send double the value of the item in Ether. When the buyer receives it, they get half of their Ether back. The other half is sent to the seller as payment. Therefore, the seller receives triple the value of their sale, as they also get their Ether refunded.

For your query, you are required to follow a few steps. I would suggest you visit here for the code and functionalities https://www.bitdegree.org/learn/solidity-examples

answered Sep 14 by Rajiv
• 3,160 points
Thanks what am looking for is a code that picks the  (msg.sender) address and alters it to another identity e.g  (msg.sender) is identified as 5.

Simple sample code with this feature missing:

pragma solidity ^ 0.4.0;

contract sender1{
    string word = "We have tied the address";
    address public issuer;
    constructor () public
    {
        issuer = msg.sender;
    }
    
    function getword() public constant returns (string) {
        return word;
    }
    
    function setword(string newword) public returns (string)
    {
    if (issuer != msg.sender)
    {
        word = "Not the message owner";
        return word;
    }
    word = newword;
    return word;
}
}

The sender address can be altered to another identity e.g 5.

Hi, @Wilson

I would suggest you go through this: https://solidity.readthedocs.io/en/v0.4.24/introduction-to-smart-contracts.html

I hope the code you want is given here.

@Wilson,

You can use hashing if you don't want to show an address.

@Gitika

Any sample code for hashing address you might be having?

Hello, @Wilson,

Regarding your query, I guess you need to follow a few steps, for that I suggest you go through this: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses

Related Questions In Blockchain

0 votes
1 answer
0 votes
2 answers
+1 vote
1 answer

what is use of msg.sender in solidity code?

msg.sender(address) function indicated the sender of the ...READ MORE

answered Apr 24, 2018 in Blockchain by Shashank
• 10,400 points
1,924 views
0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,100 points
1,176 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
409 views
0 votes
1 answer
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 69,030 points
285 views
0 votes
2 answers

how save data from different account using web3.py to smart contract

Hey, @Amal, It will automatically take the address ...READ MORE

answered Jul 27 in Blockchain by Rajiv
• 3,160 points
154 views
0 votes
2 answers

Code to change owner

Hi, @Wilson, U have to write the require ...READ MORE

answered Oct 5 in Blockchain by Rajiv
• 3,160 points
47 views