Comments (2)
I got wrong signed hashes every time with the function web3.personal.sign
.
With the following minimum PoC code, the generated result is wrong.
Of course, this code works perfectly with other environments like MetaMask and the Android version of Trust.
<html>
<head>
<script>
const sign = ()=>{
const message = 'Hello world!';
const signer = web3.eth.accounts[0];
web3.personal.sign(message, signer, (err, signature) => {
if (!err){
document.querySelector(".signer").innerText = signer;
document.querySelector(".message").innerText = message;
document.querySelector(".signature").innerText = signature;
}
});
}
</script>
</head>
<body onload="sign()">
<div>Signer: <span class="signer"></span></div>
<div>Message: <span class="message"></span></div>
<div>Signature: <span class="signature"></span></div>
</body>
</html>
The code above can be tested on the following URL.
It makes me confused that the service like OpenSea using this API works fine with Trust.
Is there another way to make a message personal-signed?
from trust-wallet-ios.
I found that the first parameter of web3.personal.sign
is needed to be converted to hex manually with the method like web3.fromUtf8
or web3.utils.utf8ToHex
.
I can get the correct result with iOS version of Trust.
The original code working with MetaMask and Android version of Trust mislead me.
from trust-wallet-ios.
Related Issues (20)
- Activate keyboard and cursor in input field
- make bootstrap fails when Installing TrezorCrypto
- Pending transaction state not being updated on the app side (parity ethereum node)
- copy ref link not working HOT 1
- How can I add kovan testnet?
- Hasher
- Use of undeclared type 'Coin' ?
- trus ios HOT 2
- ether stolen HOT 1
- Can't build HOT 3
- Use of undeclared type 'Coin' HOT 2
- I hope to restore the previous node server setup feature
- Incoming transactions marked as Sent causing negative amount on Non Multi-Coin wallets HOT 5
- Xcode 10 不能跑起来这个项目error: SWIFT_VERSION '3.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'JSONRPCKit')
- Can you provide support for TRX HOT 1
- Error installing RealmSwift
- Coin在新版的怎么处理,你们的Demo 是TrustCore (0.0.7) 我下载下来就是0.2.2 已经没有Coin
- personal_sign fails to sign 32 byte hex payload in iOS HOT 4
- eth_signTypedData_v3 for uint64 is not working correctly HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trust-wallet-ios.