Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@kazzkiq/perpera
Advanced tools
The browser bundle is built by running npm run bundle
. The resulting dist/bundle.js
file should be referenced using
a <script>
tag, which exposes the library interface through a global perpera
object.
Available networks are accessible through the perpera.networks
object: the keys are names and the values are instances
of the perpera.Network
class.
The central concept is the document.
var tag = 'foo'; // unique identifier of the document
var net = perpera.networks['peercoin']; // the blockchain used to store the document's history
var doc = new perpera.Document(tag, net);
doc.sync().then(function() {
// the document is now loaded from the underlying blockchain
});
After the promise returned by the sync()
method is fulfilled, the document's transitions
property may be inspected.
It is an array of transitions, which make up the document's history. Refer to the src/model.ts
file to understand the
structure of these objects.
In order to modify a document, specially crafted transactions are inserted into the blockchain. Funds spent on these
transactions are handled using instances of perpera.Spender
.
var wif = '...'; // private key in WIF (wallet interchange format)
var spender = perpera.Spender.fromWIF(wif, 'peercoin'); // or perpera.Network instance
spender.sync().then(function() {
// the UTXOs are now loaded into the spender instance
});
The document's content is updated by providing a collection of hash digests:
var hash = {
'sha2-256': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
};
doc.updateContent(hash, spender).then(function() {
// the transactions have been sent to the network
});
This should only be performed after both the document and the spender have been synced. If the spender is not the current owner of the document, an error is thrown without broadcasting any transactions.
It is possible to attach URIs to a document:
doc.addUri('https://example.com/foo.txt', spender).then(function() {
// the transactions have been sent to the network
});
If the given URI is too long to fit into a transaction, an error is thrown.
FAQs
PeerAssets data audit protocol library
The npm package @kazzkiq/perpera receives a total of 0 weekly downloads. As such, @kazzkiq/perpera popularity was classified as not popular.
We found that @kazzkiq/perpera demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.