Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewAddress generates wrong address compared to iota.lib.js #5

Closed
tintinweb opened this issue Aug 27, 2017 · 2 comments
Closed

NewAddress generates wrong address compared to iota.lib.js #5

tintinweb opened this issue Aug 27, 2017 · 2 comments

Comments

@tintinweb
Copy link

Hi,

Either I am doing something wrong or the libray is generating wrong addresses when calling giota.NewAddress(seed_trytes, 0, 2). Below is the output when comparing it with the iota.lib.js based electron light wallet.

trytesFrom:="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
trytes2,err:=giota.ToTrytes(trytesFrom)
adr,err:=giota.NewAddress(trytes2, 0, 2) //without checksum.

//ADDR:  SCRFLYEFBSRTSGYGWQNRUNVBXHDTIWJVGTHOFRTDLYNOQMHMJPVPNQCNQDFSVXNPYCLDCEJEWJVCFBVKS
iota.api.getNewAddress('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', {index: 0, total: 1, security:2}, function (error, addy) { if(error) { console.log(error); } else { console.log(addy); }});
//ADDR:  XUERGHWTYRTFUYKFKXURKHMFEVLOIFTTCNTXOGLDPCZ9CJLKHROOPGNAQYFJEPGK9OKUQROUECBAVNXRX

The address generated by the light wallet looks good (as it has a transaction history)

Please make sure people are not losing funds because of this by adding some unittests to check for address gen inconsistencies.

@knarz
Copy link
Contributor

knarz commented Aug 27, 2017

Hello, as stated in the first line of the README.md: Please note that this repo has not yet been updated to use Kerl.

i.e. it still generates addresses using the old hashing algorithm.

I'm working on the full transition just haven't had time to finish it yet.

@tintinweb
Copy link
Author

Excellent, thank you @knarz. Seems like I've missed that note. Would it make sense to make it a more prominent (e.g. bold and red) until kerl is merged?

Anyway, thanks for the work you put into this project! 👍

@knarz knarz closed this as completed in 9706ab9 Aug 28, 2017
luca-moser added a commit that referenced this issue Jan 30, 2019
# This is the 1st commit message:

adds account base impl.

# This is the commit message #2:

fixes SendTrytes() returning reversed bundle

let DoPoW() return trytes in bundle order

fixes AttachToTangle reversing already reversed trytes

# This is the commit message #3:

adds base implementation

# This is the commit message #4:

adds some todos

# This is the commit message #5:

makes addPendingTransfer also store the spent address indices, removes action channels by only using one, adds multi send, removes LastDepositAddress()

# This is the commit message #6:

moves account package

# This is the commit message #7:

adds clean shutdown, precomputed next dep. address, errors channel for internal errors

# This is the commit message #8:

changes state schema, adds promotion/reattachment

# This is the commit message #9:

smh

# This is the commit message #10:

adds deposit requests/conditions

# This is the commit message #11:

fixes tests

# This is the commit message #12:

split packages, make badger use gob instead of json

# This is the commit message #13:

removes SendMulti, makes Send take a variadic parameter

# This is the commit message #14:

fixes tests, reduces to single Send function, splits top level account files
luca-moser added a commit that referenced this issue Jan 30, 2019
# This is the 1st commit message:

adds account base impl.

# This is the commit message #2:

fixes SendTrytes() returning reversed bundle

let DoPoW() return trytes in bundle order

fixes AttachToTangle reversing already reversed trytes

# This is the commit message #3:

adds base implementation

# This is the commit message #4:

adds some todos

# This is the commit message #5:

makes addPendingTransfer also store the spent address indices, removes action channels by only using one, adds multi send, removes LastDepositAddress()

# This is the commit message #6:

moves account package

# This is the commit message #7:

adds clean shutdown, precomputed next dep. address, errors channel for internal errors

# This is the commit message #8:

changes state schema, adds promotion/reattachment

# This is the commit message #9:

smh

# This is the commit message #10:

adds deposit requests/conditions

# This is the commit message #11:

fixes tests

# This is the commit message #12:

split packages, make badger use gob instead of json

# This is the commit message #13:

removes SendMulti, makes Send take a variadic parameter

# This is the commit message #14:

fixes tests, reduces to single Send function, splits top level account files

# This is the commit message #15:

implements quorum based querying of nodes

# This is the commit message #16:

switch to xxhash for res body, make primary node optional

# This is the commit message #17:

moves generating hash before lock

# This is the commit message #18:

adds no response tolerance to quorum settings

# This is the commit message #19:

subtract error count from total votes

# This is the commit message #20:

fixes no-response tolerance, adds more descriptive error message

# This is the commit message #21:

adds override for commands to execute in quorum

# This is the commit message #22:

adds quorumable latest subtangle milestone query

# This is the commit message #23:

adds customizable defaults for certain calls where no quorum was reached

# This is the commit message #24:

simplify injectDefault

# This is the commit message #25:

adds partial test

# This is the commit message #26:

fixes some typos, adds additional test for explicit error responses

# This is the commit message #27:

adds UsableBalance()/TotalBalance()

# This is the commit message #28:

refactor input selection, wrap errors with more descriptive messages

# This is the commit message #29:

adds specific checks when querying the latest solid subtangle milestone

# This is the commit message #30:

fixes typo

# This is the commit message #31:

adds safe component update to account, adds special treatment for quorum findTransactions call

# This is the commit message #32:

fixes non receive events to be not fired until first poll went through

# This is the commit message #33:

modulerizes events out of the account object, adds builder pattern for creating accounts and event listeners

# This is the commit message #34:

changes store interface to return maps, optimizes pertail receive event filter, optimizes event listener registration

# This is the commit message #35:

adds correct addr gen. cancellation,fixes receive events being dropped, fixes duplicated receive events for messages
luca-moser added a commit that referenced this issue Jan 30, 2019
# This is the 1st commit message:

adds account base impl.

# This is the commit message #2:

fixes SendTrytes() returning reversed bundle

let DoPoW() return trytes in bundle order

fixes AttachToTangle reversing already reversed trytes

# This is the commit message #3:

adds base implementation

# This is the commit message #4:

adds some todos

# This is the commit message #5:

makes addPendingTransfer also store the spent address indices, removes action channels by only using one, adds multi send, removes LastDepositAddress()

# This is the commit message #6:

moves account package

# This is the commit message #7:

adds clean shutdown, precomputed next dep. address, errors channel for internal errors

# This is the commit message #8:

changes state schema, adds promotion/reattachment

# This is the commit message #9:

smh

# This is the commit message #10:

adds deposit requests/conditions

# This is the commit message #11:

fixes tests

# This is the commit message #12:

split packages, make badger use gob instead of json

# This is the commit message #13:

removes SendMulti, makes Send take a variadic parameter

# This is the commit message #14:

fixes tests, reduces to single Send function, splits top level account files

# This is the commit message #15:

implements quorum based querying of nodes

# This is the commit message #16:

switch to xxhash for res body, make primary node optional

# This is the commit message #17:

moves generating hash before lock

# This is the commit message #18:

adds no response tolerance to quorum settings

# This is the commit message #19:

subtract error count from total votes

# This is the commit message #20:

fixes no-response tolerance, adds more descriptive error message

# This is the commit message #21:

adds override for commands to execute in quorum

# This is the commit message #22:

adds quorumable latest subtangle milestone query

# This is the commit message #23:

adds customizable defaults for certain calls where no quorum was reached

# This is the commit message #24:

simplify injectDefault

# This is the commit message #25:

adds partial test

# This is the commit message #26:

fixes some typos, adds additional test for explicit error responses

# This is the commit message #27:

adds UsableBalance()/TotalBalance()

# This is the commit message #28:

refactor input selection, wrap errors with more descriptive messages

# This is the commit message #29:

adds specific checks when querying the latest solid subtangle milestone

# This is the commit message #30:

fixes typo

# This is the commit message #31:

adds safe component update to account, adds special treatment for quorum findTransactions call

# This is the commit message #32:

fixes non receive events to be not fired until first poll went through

# This is the commit message #33:

modulerizes events out of the account object, adds builder pattern for creating accounts and event listeners

# This is the commit message #34:

changes store interface to return maps, optimizes pertail receive event filter, optimizes event listener registration

# This is the commit message #35:

adds correct addr gen. cancellation,fixes receive events being dropped, fixes duplicated receive events for messages

# This is the commit message #36:

adds the concepts of plugins, makes promoter and transfer polling plugins, simplfies event machine

# This is the commit message #37:

store signatures too

# This is the commit message #38:

only store non empty signatures

# This is the commit message #39:

resolves conflicts of cherry pick

# This is the commit message #40:

dont generete addr. checksum at unnedded places, omit empty CDR fields in marshaling

# This is the commit message #41:

fixes checkConsistency for quorum, optimizes input selection, replaces event loop with RW lock, fixes promoter not having a time source, fixes transfer poller not shutting down, fixes tests, renames input selection func., optimizes request parsing of IRI calls

# This is the commit message #42:

changes pending transfer data to trytes, fixes reattacher creating inconsistent bundles, fixes primary CDRs with 0 balance being removed

# This is the commit message #43:

adjusts to latest spec

# This is the commit message #44:

adjusts json field tag for CDRs, fixes typo in plugins

# This is the commit message #45:

adds oracle package

# This is the commit message #46:

moves store impls. into own pkgs

# This is the commit message #47:

fixes gocks and removes quorum code from branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants