Comments (7)
the hex generated should definitely give you the same addresses, there is a unit test for that, are you sure you are using the right network to generate the address with php?
Address::fromPublicKey(pubKey, 104) for mainnet
from nem-php.
yup, im using -104 testnet, since im still testing out the sdk, so i dont mind share my private key here
privatekey:
1925f8049d117284ad3fb7ed8029453654613010ac887d1527fe582459da78db
Address::fromPublicKey give me :
TDSECQWGEHEE5AJMD4C3WGEGRWLPCZNHUY6ZNWK7
nano wallet give me:
TDDWELLRR4GEX3H4DN5FBEPB7WZJH5K7N5BZ6DAJ
$keypair = new NEM\Core\KeyPair("1925f8049d117284ad3fb7ed8029453654613010ac887d1527fe582459da78db"); $address = NEM\Models\Address::fromPublicKey($keypair->getPublicKey(), -104); $address_a = $address->toClean();
from nem-php.
mhmm this is indeed a weird case, I do confirm the nano address derivation for this private key.
I will try and setup a small test case, I have used this library for other projects and never had such problems, I actually always make sure that nano reproduces the same address, as a first.
I will come back to you with the test case and example, thanks for pointing this out. It could be something about how you use the classes, maybe I have been using them differently and that's what I want to check
from nem-php.
I believe there could be a problem with the Address::fromPublicKey algorithm, please let me know and try with :
$kp = KeyPair::create("1925f8049d117284ad3fb7ed8029453654613010ac887d1527fe582459da78db");
$pubKey = $kp->getPublicKey()->getHex();
$t_address = $kp->getAddress(-104); // Testnet
$n_address = $kp->getAddress(104); // Mainnet
from nem-php.
nice, i will try out later, tell me if u need anything else, i can try my best to help u
from nem-php.
sorry for the late reply,
here is the result:
pubkey:
00b3bf2f56f64d503650261102f482437a6fc3190ea0d3104b83bc42d9657b28
t_address:
TDSECQWGEHEE5AJMD4C3WGEGRWLPCZNHUY6ZNWK7
n_address:
NDSECQWGEHEE5AJMD4C3WGEGRWLPCZNHUZQJMQGZ
from nem-php.
Hello, I tried with a small test case and i cannot reproduce your case. Here is the link to the gist of the PHP used :
https://gist.github.com/evias/b30c6b8821b9c309d921188a21d44f64
I have successfully recreated the same address as Nanowallet.
You are probably doing something wrong with your private key before initializing the keypair.
from nem-php.
Related Issues (9)
- [Proposal] Conflicting dependency HOT 6
- Warning when define callbacks. HOT 2
- NEM\Models\MultisigModifications should overload serialize() to sort public keys HOT 1
- Composer Dependency Conflict with Laravel 7 HOT 1
- could not find version 0.3.0
- Error in sending transaction.
- How to generate multisig transactions HOT 3
- ModelMutator mutate argument miss match error HOT 8
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 nem-php.