Пример #1
0
 def to_addr(self, pubhex):
     assert pubhex.compressed, 'Uncompressed public keys incompatible with Segwit'
     from mmgen.protocol import hash160
     return CoinAddr(g.proto.pubhash2bech32addr(hash160(pubhex)))
Пример #2
0
def Pubhex2addr(pubkeyhex): Pubhash2addr(hash160(pubkeyhex))
def Wif2hex(wif):           Msg(PrivKey(wif=wif))
Пример #3
0
 def to_addr(self, pubhex):
     from mmgen.protocol import hash160
     assert type(pubhex) == PubKey
     return CoinAddr(g.proto.pubhash2addr(hash160(pubhex), p2sh=False))
Пример #4
0
	def pubhex2addr(self,pubkeyhex:'sstr'):
		"convert a hex pubkey to an address"
		if opt.type == 'segwit':
			return g.proto.pubhex2segwitaddr(pubkeyhex)
		else:
			return self.pubhash2addr(hash160(pubkeyhex))
Пример #5
0
def Hash160(pubkeyhex):     Msg(hash160(pubkeyhex))
def Pubhex2addr(pubkeyhex): Pubhash2addr(hash160(pubkeyhex))
Пример #6
0
def Pubhex2addr(pubkeyhex):
    Pubhash2addr(hash160(pubkeyhex))
Пример #7
0
	def hash160(self,hexstr:'sstr'):
		"compute ripemd160(sha256(data)) (convert hex pubkey to hex addr)"
		return hash160(hexstr)
Пример #8
0
def Hash160(pubkeyhex):
    Msg(hash160(pubkeyhex))
Пример #9
0
	def pubhex2addr(self,pubkeyhex:'sstr'):
		"convert a hex pubkey to an address"
		if opt.type == 'segwit':
			return g.proto.pubhex2segwitaddr(pubkeyhex)
		else:
			return self.pubhash2addr(hash160(pubkeyhex))
Пример #10
0
	def hash160(self,hexstr:'sstr'):
		"compute ripemd160(sha256(data)) (convert hex pubkey to hex addr)"
		return hash160(hexstr)
Пример #11
0
	def to_addr(self,pubhex):
		assert pubhex.compressed,'Uncompressed public keys incompatible with Segwit'
		from mmgen.protocol import hash160
		return CoinAddr(g.proto.pubhash2bech32addr(hash160(pubhex)))
Пример #12
0
	def to_addr(self,pubhex):
		from mmgen.protocol import hash160
		assert type(pubhex) == PubKey
		return CoinAddr(g.proto.pubhash2addr(hash160(pubhex),p2sh=False))