-
Notifications
You must be signed in to change notification settings - Fork 14
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
Dynafed block parsing #23
Comments
@asoltys we never touched block (de)serialization when forking from bitcoinjs. So the implementation has be done anyway since is missing also for pre-dynafed blocks. We implemented that in go-elements tho, could be another reference. Do you see any use case for browser block parsing? I would wait for neutrino support in Elements before doing any SPV like wallet in the browser |
I use it in the coinos nodejs app server to parse Blocks as they get received to check if any of the block transactions pertain to any of the wallet addresses we're tracking and update their confirmed status. Most people would probably use walletnotify in that case but we're tracking some HD wallets outside of elementsd. That said, I could probably use electrs or bwt for this instead, I think they just weren't around when I wrote the code for this. Anyways, this isn't something I expect you guys to fix. I might try to take it on though so figured it would be good to have an issue for it. I managed to get pre-dynafed blocks parsing a while ago: asoltys/elementsjs-lib@04547ed |
@asoltys very interesting, thanks for the commit! Let me see if we can allocate some time for it! Definitely interested in see the code you use to check transaction relative to an HD wallet in blocks, is it open source? |
Yes it's available here: https://github.com/coinos/coinos-server/blob/master/routes/liquid/receive.js#L190 Essentially it just loops over all the txn's in the block and checks if any were destined to an address that we have in our database which could be either from an HD wallet or our custodial node. If so, we update the payment record and user account in our db. |
Thanks! We are see to allocate to some resource to update LiquidJS to support blocks as well ( I always assumed nobody was using the block feature anyway, so thanks for heads up) |
With the dynafed upgrade going live soon, we'll need to be able to handle blocks with dynafed headers. @philippem linked me to this example that we could use as a test case: https://github.com/ElementsProject/rust-elements/blob/master/src/block.rs#L655
The Block.fromHex() method seems to have a problem handling it:
RangeError: value out of range
The text was updated successfully, but these errors were encountered: