nervosnetwork / ckb-system-scripts Goto Github PK
View Code? Open in Web Editor NEWCKB's official system scripts. Those contracts will be included in system cells in genesis blocks
CKB's official system scripts. Those contracts will be included in system cells in genesis blocks
In Bitcoin, a multisign script is written like this:
M <Public Key 1> <Public Key 2> ... <Public Key N> N CHECKMULTISIG
One can embed this script in a TX's output, and provide enough legal signatures to unlock. However, the most popular multisign method in Bitcoin is P2SH. P2SH allows users embed the Hash160 of multisign script in an UTXO, and provide original script and signatures to unlock it later.
P2SH reduces the script size to a 20bytes hash, and thus it is easy to be encoded to a multisign address.
Current multisign script on CKB is plain mode, which means the lock script has to embed and exposure all of the PKs. It costs more capacity, lack of security and privacy, and hard to be encoded to a short address.
So i suggest we follow Bitcoin's P2SH multisign method. Lock script only includes the script hash, and we use witness to provide full script.
int main(argc, args[]) {
if (argc == 2) {
// do single signature verification.
} else if (argc == 3) {
multisign_PK_hash = args[1]
multisign_script = args[2]
signers = []
PK_hash = hash()
for (signature in witness) {
PK = signature.recover()
PK_hash.append(PK)
signers.add(PK)
}
if (PK_hash != multisign_PK_hash) return -1;
return check_multisign_script(signers, multisign_script)
}
}
Keep multisign_script simple, like "2/3",and "3/5!1!4". Where "n/m" means at least n of m signature should be provided, and "!i" means one of signature must match the i-th PK.
We can migrate existing test suites for the crypto algorithms. Add use fuzz test to discover possible bugs.
Does this script secp256k1_blake160_multisig_all
have rust implementation?
via discord
razum2umYesterday at 1:54 PM
Hi, I'm just looking around and trying to compile & run ckb on arm64 just for fun, and noticed that ckb-system-scripts fails to compile because it needs this nervosnetwork/faster-hex#9
Should I make a PR to bump this line? https://github.com/nervosnetwork/ckb-system-scripts/blob/master/Cargo.toml#L19
This is an Epic, please start new issue for each objective listed below.
Security Requirements:
Security Requirements:
CI has already been setup in #15
Setup CI to automate the publishing workflow:
Security Requirements:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.