-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add support for raw script addresses #587
Add support for raw script addresses #587
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testedACK (Ubuntu 19.10)
Test makes sense and passes.
I think the new functionality is useful, especially for experimenting with smart contracts more easily. However, it seems to me that in its current form is a bit risky, the user does not know if the address obtained expresses a correct script. Currently the user could get an address that is actually based on an input: Case three could be useful in testing (devnet, testnet), but it should never be allowed in the main chain. IMHO, If the RPC was expanded so as to return addresses only when the scripts are totally valid, for example by integrating the decodescrip function, it will be an excellent improvement. |
@aguycalled I think @R-Marino has a good point about integrating the decode script into this 👍 |
thanks for the feedback. even if additional checks are implemented, an user will still be able to create addresses for unspendable scripts (OP_RETURN the most obvious example) |
Very well, great job. You are absolutely right. We as users, will always be able to find new, more sophisticated and "smart" ways of burning our money. ;-P Shortly after writing, I read a bitcoin news, which in some way could be linked to this PR. Surely this extension goes far beyond the scope of this PR, and I imagine that its possible inclusion in NAV core wallet would also require some work for integration and adaptation to some specific NAV_OP_Codes. |
if i understand it correctly, miniscript is just a higher level language for the traditional bitcoin script language. think miniscript is javascript and script is assembly. miniscript translates a set of combined logic conditions into the shortest/cheaper script code. the first is easier to construct for a common human. as this happens in higher layers, there's nothing needed to implement at the node layer more than maybe adding an interpreter for the sake of facilitating user interaction as long as the set of needed op codes is shared between bitcoin and navcoin. |
Well, more than assembler, the script reminds me more of Forth, or RPN, But the OP_CODE code set is not totally shared between Bitcoin and NavCoin, Even now we could think of singular things, for example by combining Or by combining differently, a "Slow ColdStake", which can always be spent This would already be something, but if you then create OPCODE able to give Try to imagine for example a opcode that is able to verify if the coinbase Already this would open up other opportunities, for example you could have If instead the opcode could control the outputs of the stake, you could get These hypotheses probably do not all have a practical sense, or they may have Sorry, maybe I have digress a little too much. |
@aguycalled @R-Marino are there more changes to be added to this branch? Or is it ok to review now? |
@aguycalled build and tested on Ubuntu 19.10, works fine, I also tested this merged with master and set the contribution address to Community Fund and it was sending the stakes correctly to CFUND |
Tested sending, receiving, staking and generating block in QT and all were working fine. |
Added needed for final release tag as the staking split feature is kinda missing this PR to work 100%. |
Tested on OSX,
|
This PR adds support for a new type of addresses which encode raw scripts.
A new rpc command has been added
createrawscriptaddress
.Example:
createrawscriptaddress 6ac1
outputs3HnzbJ4TR9
. Sending coins to3HnzbJ4TR9
would send them to the DAO Fund.This enables to easily redirect stake rewards to any special script (like the DAO fund).