Comments (13)
The problem is that for sig2
, you are using the tapkey
to sign, however the tapkey is a tweaked public key from Tap.getPubKey
, and you need the tweaked private key in order to sign.
There should also be a Tap.getSecKey
which you can use to get the tweaked private key, and you should be able to use that to produce a proper sig2
.
Let me know if that change fixes the issue.
The API isn't very clear in this regard, so I apologize. I'm hoping to make V2 of the library even simpler to use.
from tapscript.
@cmdruid thanks for the quick response! I just tried that but still facing the same issue. does the whole process make sense in context of the ordinal provenance docs? I think the relevant instructions are in the screenshot below. i believe i have correctly added the script tag 3
, but think I am having issues with the spending the parent in input of the child.
So far I have
- created an inscription with this same code/approach without the parent code i recently added. Inscription here: https://testnet.ordinals.com/inscription/e13f106578fe0955b375cfb66e4a212fd794b7168a7da5873fada2b78c47e035i0
- setup a testnet wallet on the address where the parent inscription is held and using the secret key hardcoded in the child inscriber
- added the
3
script tag to the script with the txid of the parent serialized according to the ordinals docs (i believe) - added the parent txid as an input to the new child inscription
- added a second signature to try and sign the transaction
from tapscript.
I'm not clear how the child tx is supposed to be formatted in order to spend the parent.
Do you have a link to a pair of example transactions that perform a successful child inscription? That would help clarify how this should be formatted.
from tapscript.
here is a child
- txn: https://mempool.space/tx/080eb48f5d1d4afeeaff6a1ca4d7dbb049578b4fcd6cdb63961d8a1ed7b85bfb
- ordinal: https://ordinals.com/inscription/080eb48f5d1d4afeeaff6a1ca4d7dbb049578b4fcd6cdb63961d8a1ed7b85bfbi0
parent
- txn: https://mempool.space/tx/b34edcf29a36f5078830a5695acf8f255348e46ba070ad0dceb43e0a7afa0ea3
- ordinal: https://ordinals.com/inscription/b34edcf29a36f5078830a5695acf8f255348e46ba070ad0dceb43e0a7afa0ea3i0
from tapscript.
Looking at the transactions that you linked, the example inscriptions do not seem to be following the documentation.
- I see the '03' being pushed, along with the 32-byte txid.
- I do not see a 4 byte index being pushed.
- There's also a '05' being pushed, with an additional blob of data. I'm not sure what that is supposed to be.
- The parent also has these attributes in the script. So is the example parent also a child to another inscription?
In any case, the second input doesn't seem to be anything important to the spec, it looks like just an input being used for fees and change. So that input should just be a simple P2TR key-spend of the selected utxo being used for fees.
from tapscript.
thanks @cmdruid
- I will check on the 4 byte index. looks like the serialisation may be correct. The spec mentions to remove trailing zeros and since it is index 0 the little endian would be all zeros and therefore not included.
- the
05
tag is passing themetadata
, see screenshot from the docs below. however this is not mandatory for parent/child - yes in the example the parent is also a child. here is the topmost child in that tree (https://ordinals.com/inscription/6390ee5c262da84fc217c8a66423750f102d35fb929eab236700f66608a877dfi0, https://mempool.space/tx/6390ee5c262da84fc217c8a66423750f102d35fb929eab236700f66608a877df)\
- Is the second input not the
Spend the parent P in one of the inputs of T.
part of the spec? Can you elaborate onSo that input should just be a simple P2TR key-spend of the selected utxo being used for fees
from tapscript.
- Is the second input not the
Spend the parent P in one of the inputs of T.
part of the spec? Can you elaborate onSo that input should just be a simple P2TR key-spend of the selected utxo being used for fees
From my understanding, only one input is handing the inscriptions stuff, so it is both spending the parent and minting the child. All the inscription related stuff should be in that tx input.
Any additional inputs are merely adding funds to the tx, and are not relevant to the inscription protocol. You can use any utxo for that, it doesn't even need to be P2TR actually.
from tapscript.
@skyrover7
Did you find a way inscribing the child inscription using Parent?
Even I was trying do the same thing , seeing your code
I think I have a suggestion
the var=endian
you are using happens to be a wrong value (i guess)
//Pass the inscription id to the below function
function convertHexString(hexString) {
// Reverse the hexadecimal string
const reversedHexString = hexString
.match(/.{2}/g) // Split string into pairs
.reverse() // Reverse the order
.join("");
// Convert reversed hex string to a byte array
const byteArray = [];
for (let i = 0; i < reversedHexString.length; i += 2) {
byteArray.push(parseInt(reversedHexString.substr(i, 2), 16));
}
// Convert byte array to hexadecimal string with '0x' prefix
const formattedHex = "0x" + Buffer.from(byteArray).toString("hex");
return formattedHex;
}
Try using the above helper function to convert
and let me know , if it worked
Coz I need your help after this !!
from tapscript.
@rohitkeshav27 nope, still no luck
i believe the endian value is correct. I am using the below function and am able to make an inscription with the delegate ID. the delegate ID and parent ID need to be serialized the same way. I have confirmed that the below code is creating the correct endian value and is recognised as a valid delegate ID. Here is an inscription with valid delegate ID using the below code for ID conversion https://ordinals.com/inscription/20bd89f9f9b29314f7995286c18a80386d245efc1f03aa76e07feb81bf1748a8i0
my trouble is still on signing the transaction, hoping @cmdruid can shine some light 🙏🏾
export function convertInscriptionId(inscriptionId) {
// Extract the TXID from the inscription ID
const txid = inscriptionId.slice(0, 64);
// Extract the INDEX value following the 'i' after the TXID
const indexPart = inscriptionId.slice(65); // Assuming the index always follows 'i' after the TXID
const index = parseInt(indexPart, 10);
// Reverse the bytes of the TXID
const reversedTxid = txid.match(/.{2}/g).reverse().join('');
// Convert the INDEX to a 4-byte little-endian format
const littleEndianIndexBuffer = Buffer.alloc(4);
littleEndianIndexBuffer.writeUInt32LE(index);
// Concatenate and return the result
let result = reversedTxid + littleEndianIndexBuffer.toString('hex');
// Omit trailing zeros
result = result.replace(/0+$/, '');
return result;
}
from tapscript.
Do you have updated code for signing the transaction?
Your previous example was using the tapkey
to sign the second input, which was incorrect. It should be the secret key that signs for that second utxo.
from tapscript.
@skyrover7
I had a doubt in your code
you are spending the parent inscription in input
But you are not creating an appropriate output , does this mean your parent inscription is spent ( lost)
and
2nd input is a taproot address , so the witness passed also shd be like the first input
There is something missing !!
rohitkeshav
the above is my discord username - we could connect and work this together ( coz even I have an urgent need to complete this )
from tapscript.
@rohitkeshav27 sent you a fr on discord
from tapscript.
I am closing this for now. Feel free to reopen this issue if you still need help.
from tapscript.
Related Issues (20)
- Taptree Example sounds strange HOT 5
- PSBT support HOT 10
- {"code":-26,"message":"non-mandatory-script-verify-flag (Witness program hash mismatch)"} HOT 6
- Tap script inquiry HOT 3
- Witness program hash mismatch HOT 2
- Custom Address Prefix HOT 1
- ReferenceError: crypto is not defined HOT 2
- ReferenceError: crypto is not defined HOT 1
- Public key version reserved for soft-fork upgrades HOT 3
- Add Metadata to inscription HOT 1
- Error: Size greater than stream: 38133322 > 56518 HOT 16
- A test failure HOT 3
- In the examples, where is the scriptPubKey address comming from? HOT 1
- Add multiple parent to a child inscription HOT 2
- Runes HOT 1
- OP_RETURN in output HOT 6
- sponsors? HOT 1
- Invalid Schnorr Siganture - Example: Basic Pay-to-Pubkey Spending HOT 1
- Examples are outdated. HOT 2
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 tapscript.