Comments (5)
Update: This change would remove the validation capability. There would need to be a second call or some other method to ensure an SLP UTXO is valid.
from slp-sdk.
After conversing with the team on this, perhaps a preferred workflow for this function would be:
- Raw transaction data for every UTXO is retrieved from the full node.
- For those TXs without an OP_RETURN, the entry is marked
false
to indicate it is not an SLP UTXO. - For those TXs with an OP_RETURN, the data is parsed for SLP data.
a. If the data can not be parsed, the UTXO is markedfalse
to indicate it is not an SLP UTXO.
b. If the data can be parsed, the TXID is sent to SLPDB to ask if the UTXO is valid. - (after 3b only) SLPDB is called to validate the UTXO.
a. AnisValid
property is marked false if SLPDB returnsnull
orfalse
.
b. AnisValid
property is marked true if SLPDB returnstrue
.
from slp-sdk.
Looks like a good solution, if the validation here would be too heavy, the apps could also rely on a second call such as to validatetxid
. Assuming this endpoint always has accurate information.
https://developer.bitcoin.com/slp/docs/js/util#validatetxid
Also regarding isValid
, I think the property needs to be null
or false
if it's false in SLPDB, true
if marked as true, and some indeterminate
value if it's an SLP UTXO but unknown to SLPDB.
from slp-sdk.
PR #86 implements the following features:
- if
false
is returned, the UTXO is safe to spend by an SLP-aware wallet. - If the UTXO is colored with SLP information, then it includes an
isValid
property along with the other SLP information.- If SLPDB is not aware of the SLP UTXO,
isValid
will have a property ofnull
. - If SLPDB has processed the SLP UTXO,
isValid
will have a property of eithertrue
orfalse
to indicate its SLP validity.
- If SLPDB is not aware of the SLP UTXO,
from slp-sdk.
This issue satisfied by PR #86
from slp-sdk.
Related Issues (20)
- Allow multiple input addresses in mint operation HOT 2
- Use REST validateTxid method instead of LocalValidator HOT 3
- Lodash broken, won't fix HOT 6
- Babel broken - needs upgrade HOT 1
- Readme Link to SLP API docs is broken/404 HOT 1
- Missing type definition file in root dir
- Required properties should be checked
- Example burn-all is broken HOT 1
- Cannot read property 'concat' of undefined on sending HOT 3
- Determine if utxo is colored on client side
- Is it possible for bch to get burnt in the non slp wallet during burning of slp tokens? HOT 2
- Feature request: Improve docs navigation
- SLPDB URL should not be hard coded.
- slpjs should be configurable for other rest servers HOT 1
- create-wallet example is not working in the browser HOT 2
- Refactor Util.isTokenUtxo()
- Websocket listen no longer works
- TokenType1.mint does not support array for fundingAddress and fundingWif HOT 1
- Error: Transaction has no inputs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slp-sdk.