Generate address from output script#202
Generate address from output script#202sekulicd wants to merge 38 commits intovulpemventures:masterfrom
Conversation
| return script | ||
| } | ||
|
|
||
| func FromOutputScript( |
There was a problem hiding this comment.
This method should stay in address package and should not make use of the payment one, like a "raw" address builder.
The idea is to allow the user to retrieve and address from an output script with either address or payment. The former lacks such API, while the latter already provides the necessary ones.
There was a problem hiding this comment.
yeah, thing is that if adding it to address pkg can use payment cause of cyclic import.
There was a problem hiding this comment.
I was trying to say that this function should be moved to address and its implementation must change so that it doesn't make use of payment's types/functions.
There was a problem hiding this comment.
I suggest you don't look at the liquidjs-lib implementation, rather this function should analyze the incoming script to understand its type and encode it to an address using the proper format (base58, bech32...).
I would remove also the blinding key argument and return always an unconfidential address from an output script to keep it simple. The user can translate it to confidential with existing types and functions of the address package if needed.
This adds FromOutputScript func to the payment pkg which is supposed to create address from provided output script.
@tiero @altafan please review.