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

How to convert deserialized script into address #88

Open
1029219814 opened this issue Jul 25, 2023 · 4 comments
Open

How to convert deserialized script into address #88

1029219814 opened this issue Jul 25, 2023 · 4 comments

Comments

@1029219814
Copy link

About outs when eg using zencashjs.transaction.deserializeTx method. I can only get satoshis and script, I want to know how to get the real address through script

{
version: 1,
locktime: 0,
ins: [{
output: [Object],
script: '',
sequence: 'ffffffff',
prevScriptPubKey: ''
}],
outs: [{
satoshis: 100000,
script: '76a914da46f44467949ac9321b16402c32bbeede5e3e5f88ac200206260143838b5ff52dc2eb7b4b8099d4e4c99dc3ef19794289a2cd4c10070000b4'
}]
}

example:How to get the corresponding address through 76a914da46f44467949ac9321b16402c32bbeede5e3e5f88ac200206260143838b5ff52dc2eb7b4b8099d4e4c99dc3ef19794289a2cd4c10070000b4

@ADumaine
Copy link
Collaborator

You can use:
zen-cli decodescript '76a914da46f44467949ac9321b16402c32bbeede5e3e5f88ac200206260143838b5ff52dc2eb7b4b8099d4e4c99dc3ef19794289a2cd4c10070000b4'

@1029219814
Copy link
Author

Thanks. Is there no sdk at present? Is there a js version or a java version? I don’t know much about the c language.

@ADumaine
Copy link
Collaborator

The only way to decode is with the zend cli as far as I know.
It can be called from a node.js project using rpc calls. It just means having a local node available.

@1029219814
Copy link
Author

OK, thanks. I'll try to see if I can convert the decrypted c code into js or java

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