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, 2020 in Blockchain by Wilson
• 140 points
2,021 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, 2020 by Rajiv
• 8,870 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

Is the msg.sender address changed while passing to another contract as a parameter?

I tried your contracts in Remix, but ...READ MORE

answered Oct 10, 2018 in Blockchain by Omkar
• 69,220 points
1,371 views
0 votes
2 answers

Why is network already up to date while trying to deploy a contract on truffle?

I guess you have ganache running already ...READ MORE

answered Apr 24, 2018 in Blockchain by Shashank
• 10,400 points
4,594 views
+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 25, 2018 in Blockchain by Shashank
• 10,400 points
9,204 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
3,624 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,790 points
1,943 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,469 views
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,220 points
1,483 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 28, 2020 in Blockchain by Rajiv
• 8,870 points
1,542 views
0 votes
2 answers

Code to change owner

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

answered Oct 5, 2020 in Blockchain by Rajiv
• 8,870 points
1,889 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP