Package com.bitsofproof.supernode.api

Examples of com.bitsofproof.supernode.api.Address


    {
      TransactionInput i = transaction.getInputs ().get (j);
      ScriptFormat.Writer sw = new ScriptFormat.Writer ();
      if ( ScriptFormat.isPayToAddress (s.getScript ()) )
      {
        Address address = s.getOutputAddress ();
        Key key = getKeyForAddress (address);
        if ( key == null )
        {
          throw new ValidationException ("Have no key to spend this output");
        }
View Full Code Here


      {
        decrypted[i] ^= derived[i];
      }
      ECKeyPair kp = new ECKeyPair (decrypted, compressed);

      byte[] acs = Hash.hash (new Address (network, kp.getAddress ()).toString ().getBytes ("US-ASCII"));
      byte[] check = new byte[4];
      System.arraycopy (acs, 0, check, 0, 4);
      if ( !Arrays.equals (check, addressHash) )
      {
        throw new ValidationException ("failed to decrpyt");
View Full Code Here

      System.arraycopy (decrypted2, 8, seed, 16, 8);
      BigInteger priv =
          new BigInteger (1, passfactor).multiply (new BigInteger (1, Hash.hash (seed))).remainder (SECNamedCurves.getByName ("secp256k1").getN ());

      kp = new ECKeyPair (priv, compressed);
      byte[] acs = Hash.hash (new Address (network, kp.getAddress ()).toString ().getBytes ("US-ASCII"));
      byte[] check = new byte[4];
      System.arraycopy (acs, 0, check, 0, 4);
      if ( !Arrays.equals (check, addressHash) )
      {
        throw new ValidationException ("failed to decrpyt");
View Full Code Here

    byte[] addressHash = new byte[4];
    byte[] aesKey = new byte[32];
    byte[] xor = new byte[32];
    try
    {
      byte[] ac = Hash.hash (new Address (network, key.getAddress ()).toString ().getBytes ("US-ASCII"));
      System.arraycopy (ac, 0, addressHash, 0, 4);
      System.arraycopy (ac, 0, store, 3, 4);
      byte[] derived = SCrypt.generate (passphrase.getBytes ("UTF-8"), addressHash, 16384, 8, 8, 64);
      System.arraycopy (derived, 32, aesKey, 0, 32);
      System.arraycopy (derived, 0, xor, 0, 32);
View Full Code Here

  @Override
  public Address getAddress ()
  {
    try
    {
      return new Address (Address.Type.COMMON, Hash.keyHash (pub));
    }
    catch ( ValidationException e )
    {
      return null;
    }
View Full Code Here

      List<ScriptFormat.Token> parsed = parse (script);
      if ( parsed.size () == 5 && parsed.get (0).op == ScriptFormat.Opcode.OP_DUP && parsed.get (1).op == ScriptFormat.Opcode.OP_HASH160
          && parsed.get (2).data != null && parsed.get (2).data.length == 20 && parsed.get (3).op == ScriptFormat.Opcode.OP_EQUALVERIFY
          && parsed.get (4).op == ScriptFormat.Opcode.OP_CHECKSIG )
      {
        return new Address (Type.COMMON, parsed.get (2).data);
      }
      if ( parsed.size () == 3 && parsed.get (0).op == ScriptFormat.Opcode.OP_HASH160 && (parsed.get (1).data != null && parsed.get (1).op.o <= 75)
          && parsed.get (1).data.length == 20 && parsed.get (2).op == ScriptFormat.Opcode.OP_EQUAL )
      {
        return new Address (Type.P2SH, parsed.get (1).data);
      }
    }
    catch ( Exception e )
    {
    }
View Full Code Here

  @Override
  public Address getAddress ()
  {
    try
    {
      return new Address (Address.Type.COMMON, Hash.keyHash (pub));
    }
    catch ( ValidationException e )
    {
      return null;
    }
View Full Code Here

TOP

Related Classes of com.bitsofproof.supernode.api.Address

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.