Closed mr-zwets closed 9 months ago
Avance
We made some progress on this today.
What we still need to do:
We need to provide a way for developers to generate signatures for their CashScript transactions without needing to pass in the private key, such as through WalletConnect. For this we should talk to some developers that have created CashScript dapps that people can interact with without having a built-in web wallet on the website. Perhaps it makes sense for us to already make the bytecodeGenerator
functions async
in anticipation of it.
Today we added the automatic "bytecode generator" generator generation (working title) for contracts and P2PKH and we addedd some tests. So we are mostly feature complete for this, but we still need to make some fixes, change some namings, and add more tests and docs. We've updated the checklist above.
We've added all the tests we wanted to add and made a start with the docs.
We finished work on the advanced transaction builder and released it with version 0.9.0 🥳
With native introspection it is possible to add a tracking contract contract which does not change addresses to a simulated state contract which does. Getting the latest state of a simulated state contract then doesn't require replaying the whole history but instead only look at the UTXO on the tracking contract address and query the other output in the transaction that created the tracking UTXO. The cashscript contract of the tracking contract would look like this:
Unfortunately such tracking contract can not be used with the current cashscript SDK as it is made with the idea of spending from a single contract function at a time.
Besides the tracking contract, I'm not aware of other usecases of spending from mutiple different contracts at a time so maybe a simple
.experimentalFromP2SH(TrackingContract.functions.SpendBoth())
would be a good solution.Alternatively a more conceptual solution would be to make .from() .to() and .send() methods on a transaction object and the .from() would require either a P2PKH unlock or a contract object with a spending function and the unlocking arguments.