TransWikia.com

Sign message twice with web3

Ethereum Asked by P_F on December 7, 2021

a quick beginner’s question… is it possible to sign a message twice with web3? For example Alice creates a message and signs it. Then it is sent to Bob. Can Bob sign the message before he executes the transaction to make sure that the message was accepted by both of them?

Thanks a lot!

One Answer

Just take the signed message of Alice and use it as a message to sign by Bob

var alice_signature;
var message = "Some Text ";
web3.personal.sign( web3.fromUtf8( message), <Alice> , function( err, signature ) {
      alice_signature = signature;
      send_to_bob(signature,message);
})

And then, for example

var message = message_from_alice + signature_from alice
web3.personal.sign( web3.fromUtf8( message ), <Bob> , function( err, signature ) {
      console.log(signature);
})

Answered by waytosay on December 7, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP