public KzBScriptPubP2PKH(KzUInt160 pubKeyHash) { IsPub = true; _TemplateId = KzScriptTemplateId.P2PKH; this .Add(KzOpcode.OP_DUP) .Add(KzOpcode.OP_HASH160) .Push(pubKeyHash.Span) .Add(KzOpcode.OP_EQUALVERIFY) .Add(KzOpcode.OP_CHECKSIG) ; }
public KzWalletJarvis(string passPhrase) { var m = KzExtPrivKey.Master(passPhrase, new[] { _kp_magic, _kp_protocol }); if (m == null) { throw new ArgumentException("This pass phrase cannot be used. Please generate another with at least 256 bits of entropy."); } _magic = m.Derive(_kp_magic).GetPubKey().ToHash160(); _protocolKey = m.Derive(_kp_protocol.Parent); _task = Task.Run(async() => await JarvisMain()); }
public void Decode() { foreach (var hex in new [] { "76a914c2eaba3b9c29575322c6e24fdc1b49bdfe405bad88ac", "4730440220327588eb1c9e502358142b67b3cd799cb6163fde4f1a92490affda78734bc63c0220639a29e63d78c971177a1792cec1b0a7e65c973edbf03eba3b3380d97b829f80412103ea03d07638e40b53d8098b62e964112f562af5ba1bffaa146ffd9e7f7d1a5c67", "6a22314c74794d45366235416e4d6f70517242504c6b3446474e3855427568784b71726e0101337b2274223a32302e36322c2268223a35392c2270223a313031322c2263223a312c227773223a362e322c227764223a3236307d22314a6d64484e4456336f6434796e614c7635696b4d6234616f763737507a665169580a31353537303838383133" }) { var sb = new KzScript(hex); var s = sb.ToString(); } var address = new KzPubKey(true); var e = new KzUInt160("c2eaba3b9c29575322c6e24fdc1b49bdfe405bad", true); var s1 = KzEncoders.B58Check.Encode(Kz.PUBKEY_ADDRESS, e.ReadOnlySpan); var s2 = KzEncoders.B58Check.Encode(Kz.SCRIPT_ADDRESS, e.ReadOnlySpan); //e.Span.CopyTo(address.Span); //var id = address.GetID(); }