{"_id":"@aidpproject/aidpcoin-sign-transaction","_rev":"6-f2dcf09346d2f3e1455284a04c70a760","name":"@aidpproject/aidpcoin-sign-transaction","dist-tags":{"latest":"0.2.18"},"versions":{"0.2.12":{"name":"@aidpproject/aidpcoin-sign-transaction","version":"0.2.12","keywords":["ravencoin"],"author":{"name":"Raven Rebels - Dick Henrik Larsson"},"license":"MIT","_id":"@aidpproject/aidpcoin-sign-transaction@0.2.12","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"dist":{"shasum":"1f51d1aed2e745def08a812f6eeb3e6eea341ea5","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.12.tgz","fileCount":21,"integrity":"sha512-Nfo5YEQ9JgdaD/M9I50Crirr2VVLHQH2MzC7vTA0ytKBuDgaLzB5I5tOvY3AuOGi9+phHuvJGSkgGv4NXPY3mQ==","signatures":[{"sig":"MEUCIQCG18oeycUBRbi9SDBILgwj0VgqSRWrb2eCqZGCfe6wpQIgGx0XwUQWvqx+o4CyBtyJUzvCRB51j1QKSClRqda6XRo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75051},"main":"dist/index.cjs","types":"dist/types.d.ts","module":"dist/index.mjs","source":"index.ts","gitHead":"20fe359fc5fd2100a84c9cfc5fc70439872686c9","scripts":{"test":"jest","build":"parcel build --no-content-hash","postinstall":"node copyFile"},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"repository":{"url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git","type":"git"},"_npmVersion":"10.2.4","description":"Signs a Aidpcoin transaction","directories":{},"_nodeVersion":"20.11.1","dependencies":{"bitcoinjs-lib":"^5.2.0","@hyperbitjs/chains":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5","@types/node":"^18.14.0","@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3"},"_npmOperationalInternal":{"tmp":"tmp/aidpcoin-sign-transaction_0.2.12_1709949319215_0.014594866346893554","host":"s3://npm-registry-packages"}},"0.2.13":{"name":"@aidpproject/aidpcoin-sign-transaction","version":"0.2.13","keywords":["aidpcoin"],"author":{"name":"Rebels - Dick Henrik Larsson"},"license":"MIT","_id":"@aidpproject/aidpcoin-sign-transaction@0.2.13","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"dist":{"shasum":"a79308924a41dd20fd7bf95f3bba4af7fc0becac","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.13.tgz","fileCount":21,"integrity":"sha512-lu+C7LvCW9jb+1dNP31lVWysluEsHRsv+8pKByqARx4zCr8IsWlCUJm8tIExAjoGeqE0seH+T5wZxROUgljAeA==","signatures":[{"sig":"MEQCIGZAxEMUzdKcL/CYRth04k9jxc+Amow5q6xChaEiYzpJAiAqyTjm+OSgty4WXXfjhUv5ogkhUz+YFseZuH09i/mueg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75046},"main":"dist/index.cjs","types":"dist/types.d.ts","module":"dist/index.mjs","source":"index.ts","gitHead":"20fe359fc5fd2100a84c9cfc5fc70439872686c9","scripts":{"test":"jest","build":"parcel build --no-content-hash","postinstall":"node copyFile"},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"repository":{"url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git","type":"git"},"_npmVersion":"10.2.4","description":"Signs a Aidpcoin transaction","directories":{},"_nodeVersion":"20.11.1","dependencies":{"bitcoinjs-lib":"^5.2.0","@hyperbitjs/chains":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5","@types/node":"^18.14.0","@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3"},"_npmOperationalInternal":{"tmp":"tmp/aidpcoin-sign-transaction_0.2.13_1709993870561_0.19211377817473663","host":"s3://npm-registry-packages"}},"0.2.14":{"name":"@aidpproject/aidpcoin-sign-transaction","version":"0.2.14","keywords":["aidpcoin"],"author":{"name":"Rebels - Dick Henrik Larsson"},"license":"MIT","_id":"@aidpproject/aidpcoin-sign-transaction@0.2.14","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"dist":{"shasum":"3fd064899ed0f045827724ed5fc1b7aef1166e99","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.14.tgz","fileCount":21,"integrity":"sha512-jIiEeImB9Mt1JXHW25t6awTrhbLFrHwzVhWBfnxC32jWix5bxKzZzQWJ1dtA4GUMuWmlqdTGXZC1F4zSKiwjfA==","signatures":[{"sig":"MEQCIHkGjn+HFS+FdAA36jDHmsRZf5460o0vJucSJR9bhw6uAiA46qvrvmy7Q9rep5nQkmV4aqEcIIFmM/jnakS20HE7Fg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75046},"main":"dist/index.cjs","types":"dist/types.d.ts","module":"dist/index.mjs","source":"index.ts","gitHead":"20fe359fc5fd2100a84c9cfc5fc70439872686c9","scripts":{"test":"jest","build":"parcel build --no-content-hash","postinstall":"node copyFile"},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"repository":{"url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git","type":"git"},"_npmVersion":"10.2.4","description":"Signs a Aidpcoin transaction","directories":{},"_nodeVersion":"20.11.1","dependencies":{"bitcoinjs-lib":"^5.2.0","@hyperbitjs/chains":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5","@types/node":"^18.14.0","@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3"},"_npmOperationalInternal":{"tmp":"tmp/aidpcoin-sign-transaction_0.2.14_1710035276815_0.031670810556544415","host":"s3://npm-registry-packages"}},"0.2.15":{"name":"@aidpproject/aidpcoin-sign-transaction","version":"0.2.15","keywords":["aidpcoin"],"author":{"name":"Rebels - Dick Henrik Larsson"},"license":"MIT","_id":"@aidpproject/aidpcoin-sign-transaction@0.2.15","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"dist":{"shasum":"ff3dada89e6710ed2fcfdef55ada8a8b881b76a2","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.15.tgz","fileCount":21,"integrity":"sha512-9xHhVYzkBzaU8oYI8KjnwaFkmEXG1NOCpHVF9AkLcbO0Kdn3mlnh8CaGgY7FL9+8FCfSk2P+vX6L9d9xn5BVtQ==","signatures":[{"sig":"MEUCIHXZ+mJh9743hZBzTrowmRl1ed7gIFfWepEpMlvhZwdeAiEA2eg1h6XgZnDn1WzzIw0GnVSb5ogwIr8RFyIsaXirOJU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75014},"main":"dist/index.cjs","types":"dist/types.d.ts","module":"dist/index.mjs","source":"index.ts","gitHead":"20fe359fc5fd2100a84c9cfc5fc70439872686c9","scripts":{"test":"jest","build":"parcel build --no-content-hash","postinstall":"node copyFile"},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"repository":{"url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git","type":"git"},"_npmVersion":"10.2.4","description":"Signs a Aidpcoin transaction","directories":{},"_nodeVersion":"20.11.1","dependencies":{"bitcoinjs-lib":"^5.2.0","@hyperbitjs/chains":"^0.3.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5","@types/node":"^18.14.0","@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3"},"_npmOperationalInternal":{"tmp":"tmp/aidpcoin-sign-transaction_0.2.15_1710102153222_0.44864068605535223","host":"s3://npm-registry-packages"}},"0.2.16":{"name":"@aidpproject/aidpcoin-sign-transaction","version":"0.2.16","keywords":["aidpcoin"],"author":{"name":"Raven Rebels - Dick Henrik Larsson"},"license":"MIT","_id":"@aidpproject/aidpcoin-sign-transaction@0.2.16","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"dist":{"shasum":"704a641175d54c145ca10aa31764fb2fe7b4ef9a","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.16.tgz","fileCount":21,"integrity":"sha512-34VXVFOzPRV5fMeu1IfyBLtRi46qZ1bMvhflvh8Z0ivRiZOiFd+hh76RPfGsbqPMMc/9WKhzGfqlY1CX8VubnA==","signatures":[{"sig":"MEUCIFkJJUWA/Q10775GEsyAwTERAgc8YHTTjH5v3SaWYlYBAiEA58v6gAN7RYtUymSRRnS5+a7DGcMp115sr15/t1CgKsY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75270},"main":"dist/index.cjs","types":"dist/types.d.ts","module":"dist/index.mjs","source":"index.ts","gitHead":"33a04e1576d8c8ee56fd7abbb9bf7ba061858cd4","scripts":{"test":"jest","build":"parcel build --no-content-hash","postinstall":"node copyFile"},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"repository":{"url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git","type":"git"},"_npmVersion":"10.8.2","description":"Signs a Aidpcoin transaction","directories":{},"_nodeVersion":"20.17.0","dependencies":{"bitcoinjs-lib":"^5.2.0","@aidpproject/chains":"^1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5","@types/node":"^18.14.0","@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3"},"_npmOperationalInternal":{"tmp":"tmp/aidpcoin-sign-transaction_0.2.16_1726415789535_0.5549827288133482","host":"s3://npm-registry-packages"}},"0.2.17":{"name":"@aidpproject/aidpcoin-sign-transaction","version":"0.2.17","keywords":["aidpcoin"],"author":{"name":"Raven Rebels - Dick Henrik Larsson"},"license":"MIT","_id":"@aidpproject/aidpcoin-sign-transaction@0.2.17","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"dist":{"shasum":"07e9a7dc917b2adc22a982fe5635a9f216e5272e","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.17.tgz","fileCount":21,"integrity":"sha512-8ZeC2XEnHDPtuSe9iKYQ1H2DBT1XP646SVERjqFWwcTCBIJVbwXdl+jHRPQc1bCI6xAZ26PKQLQXSt39X+OXeQ==","signatures":[{"sig":"MEUCIBN6iIka/S3yM4J59b4KWJCCl6v8rgubYdPgxUMzHj6KAiEAz9kuyAB/LYzaiKMMtSSZn6Xcir9T8sqMrRj4aATVPzc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75275},"main":"dist/index.cjs","types":"dist/types.d.ts","module":"dist/index.mjs","source":"index.ts","gitHead":"33a04e1576d8c8ee56fd7abbb9bf7ba061858cd4","scripts":{"test":"jest","build":"parcel build --no-content-hash","postinstall":"node copyFile"},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"repository":{"url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git","type":"git"},"_npmVersion":"10.7.0","description":"Signs a Aidpcoin transaction","directories":{},"_nodeVersion":"18.20.4","dependencies":{"bitcoinjs-lib":"^5.2.0","@aidpproject/chains":"^1.6.2"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5","@types/node":"^18.14.0","@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3"},"_npmOperationalInternal":{"tmp":"tmp/aidpcoin-sign-transaction_0.2.17_1727006823825_0.5303537200468311","host":"s3://npm-registry-packages"}},"0.2.18":{"name":"@aidpproject/aidpcoin-sign-transaction","description":"Signs a Aidpcoin transaction","version":"0.2.18","source":"index.ts","main":"dist/index.cjs","module":"dist/index.mjs","types":"dist/types.d.ts","scripts":{"build":"parcel build --no-content-hash","postinstall":"node copyFile","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git"},"keywords":["aidpcoin"],"author":{"name":"Raven Rebels - Dick Henrik Larsson"},"license":"MIT","bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","dependencies":{"@aidpproject/chains":"^1.6.2","bitcoinjs-lib":"^5.2.0"},"devDependencies":{"@parcel/packager-ts":"^2.8.3","@parcel/transformer-typescript-types":"^2.8.3","@types/node":"^18.14.0","jest":"^29.4.3","parcel":"^2.8.3","typescript":"^4.9.5"},"_id":"@aidpproject/aidpcoin-sign-transaction@0.2.18","gitHead":"884891d329961d63d22d645822b9ae00380c53e5","_nodeVersion":"18.20.4","_npmVersion":"10.7.0","dist":{"integrity":"sha512-7lcCa8QsclbIJZWKnVe2eQx1Gzuaj5r1mMfCZ7TZ9L7zmRFfKzMXqA3B7R0XX/KKMpLiG3H4cnZ6qBLB8Ppktw==","shasum":"921007bd8658c0e09df7cded28ba3903f52d95de","tarball":"https://registry.npmjs.org/@aidpproject/aidpcoin-sign-transaction/-/aidpcoin-sign-transaction-0.2.18.tgz","fileCount":21,"unpackedSize":75308,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnDQ7YgWqNFAxKf3hwOiGHfpb90NkK53pHEY0qgNIlOAiEAgGXgSb5ivnpu6FxGVHEIsdPrUR5DKGmpp/93xf5EJ38="}]},"_npmUser":{"name":"loloadsl","email":"loloadsl@hotmail.fr"},"directories":{},"maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/aidpcoin-sign-transaction_0.2.18_1727121703894_0.4981993893534795"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-09T01:55:19.093Z","modified":"2024-09-23T20:01:44.331Z","0.2.12":"2024-03-09T01:55:19.408Z","0.2.13":"2024-03-09T14:17:50.705Z","0.2.14":"2024-03-10T01:47:56.963Z","0.2.15":"2024-03-10T20:22:33.421Z","0.2.16":"2024-09-15T15:56:29.759Z","0.2.17":"2024-09-22T12:07:04.034Z","0.2.18":"2024-09-23T20:01:44.121Z"},"bugs":{"url":"https://github.com/aidpproject/aidpcoin-sign-transaction/issues"},"author":{"name":"Raven Rebels - Dick Henrik Larsson"},"license":"MIT","homepage":"https://github.com/aidpproject/aidpcoin-sign-transaction#readme","keywords":["aidpcoin"],"repository":{"type":"git","url":"git+https://github.com/aidpproject/aidpcoin-sign-transaction.git"},"description":"Signs a Aidpcoin transaction","maintainers":[{"name":"loloadsl","email":"loloadsl@hotmail.fr"}],"readme":"# aidpcoin-sign-transaction\n\nSigns a Aidpcoin transaction\n\nThe sole purpose of this project is to enable us to\n\"Sign AIDP or asset transfer transactions in pure JavaScript\"\n\n## Working proof of concept.\n\nWe are able to sign Aidpcoin asset transfers using bitcoinjs-lib version 5.2 with a patched\nTransaction Builder.\n\n## How to use\n\nThe sign method has four arguments\n1) The network \"string\", can be \"aidp\" | \"aidp-test\" | \"evr\" | \"evr-test\",\n2) The raw transaction (in hex)\n3) An array of UTXO objects to use\n4) Private keys. An object with \"address\" as key and \"WIF\" as value\n\nreturns a signed transaction (hex), after that it is up to you to publish it on the network\n```\nimport Signer from \"@aidpproject/aidpcoin-sign-transaction\";\n\nconst raw =\n  \"0200000002fe6cfe20184b592849231eea8167e3de073b6ec1b8218c2ef36838a4e07dd11c0200000000ffffffff28c32b825b14251708ea39c0ac706bd3d933778d7838d01b678b045a48e219950000000000ffffffff0200000000000000003a76a91416014dfb02a07417cbf8c0366ee5ae0a29d5878f88acc01e72766e74114652454e2f59554c45544944453230323100e1f5050000000075000e2707000000001976a914c6a0e8557c7567a4d9cc84574c34fbb62ece3c9688ac00000000\";\nconst UTXOs = [\n  {\n    address: \"RTPSdYw3iB93L6Hb9xWd1ixVxPYu1QePdi\",\n    assetName: \"AIDP\",\n    txid: \"1cd17de0a43868f32e8c21b8c16e3b07dee36781ea1e234928594b1820fe6cfe\",\n    outputIndex: 2,\n    script: \"76a914c6a0e8557c7567a4d9cc84574c34fbb62ece3c9688ac\",\n    satoshis: 122000000,\n    height: 2670673,\n  },\n  {\n    address: \"RSuQSgXXr1z4gKommSqhHLffiNxnSE3Bwn\",\n    assetName: \"FREN/YULETIDE2021\",\n    txid: \"9519e2485a048b671bd038788d7733d9d36b70acc039ea081725145b822bc328\",\n    outputIndex: 0,\n    script:\n      \"76a914c1536f46fa2fa04be210406529be283c1c85e4ce88acc01e72766e74114652454e2f59554c45544944453230323100e1f5050000000075\",\n    satoshis: 100000000,\n    height: 2670669,\n  },\n];\nconst privateKeys = {\n  RTPSdYw3iB93L6Hb9xWd1ixVxPYu1QePdi:\n    \"L2GD7txjmdKSTy7mBq2FowZusjdWP679ttWSRfj4eLBu2usTWMV9\",\n  RSuQSgXXr1z4gKommSqhHLffiNxnSE3Bwn:\n    \"Kxj2xMvLbcXeGzuSrZLtpnZWzXnTXnhtuCQRQhKLjN7bSQXuakyh\",\n};\nconst signed = Signer.sign(\"aidp\", raw, UTXOs, privateKeys);\nconsole.log(signed);\n\n\n```\n\n## What we need\n\nWe need code that can take the UNSIGNED transaction, and sign it using the private keys.\nThis transaction transfers one FREN/CIVILAZATION asset/token and pays fees in AIDP.\n\n[decoded UNSIGNED transaction](./mock/decodedUnsignedTransaction.json)\n\n[decoded SIGNED transaction](./mock/decodedSignedTransaction.json)\n\n[Private keys](./mock/privateKeys.json)\n\n## Important stuff learned\n\n- Signing a transaction means, sign the inputs to the transaction and sign the whole transaction.\n\n- To sign a transaction, inputs and outputs are not enough, we need the UTXOs used (to get each utxo.script)\n\n- bitcoinjs-lib cant sign an unsigned transaction from Aidpcoin out of the box because\n  of this line in transaction_builder.js\n\n  `const prevOutScript = payments.p2pkh({ pubkey: ourPubKey }).output;`\n\n  That is, transaction_builder assumes that the previous outputscript was \"just\" our pub key/address, that is not true in the case of Aidpcoin asset transfer transactions.\n\n## Stuff to look at\n\nhttps://github.com/bitpay/bitcore-lib/blob/master/lib/script/script.js\n","readmeFilename":"README.md"}